com.adobe.ride:ride-performance-lib

Adobe Ride Parent Pom

License

License

Categories

Categories

IDE Development Tools ORM Data
GroupId

GroupId

com.adobe.ride
ArtifactId

ArtifactId

ride-performance-lib
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Adobe Ride Parent Pom

Download ride-performance-lib

How to add to project

<!-- https://jarcasting.com/artifacts/com.adobe.ride/ride-performance-lib/ -->
<dependency>
    <groupId>com.adobe.ride</groupId>
    <artifactId>ride-performance-lib</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.adobe.ride/ride-performance-lib/
implementation 'com.adobe.ride:ride-performance-lib:2.0.0'
// https://jarcasting.com/artifacts/com.adobe.ride/ride-performance-lib/
implementation ("com.adobe.ride:ride-performance-lib:2.0.0")
'com.adobe.ride:ride-performance-lib:jar:2.0.0'
<dependency org="com.adobe.ride" name="ride-performance-lib" rev="2.0.0">
  <artifact name="ride-performance-lib" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.adobe.ride', module='ride-performance-lib', version='2.0.0')
)
libraryDependencies += "com.adobe.ride" % "ride-performance-lib" % "2.0.0"
[com.adobe.ride/ride-performance-lib "2.0.0"]

Dependencies

compile (15)

Group / Artifact Type Version
io.gatling : gatling-app jar 2.3.1
io.gatling.highcharts : gatling-charts-highcharts jar 2.3.1
org.scala-lang.modules : scala-parser-combinators_2.12 jar 1.1.0
org.testng : testng jar 6.14.3
io.rest-assured : rest-assured jar 3.0.6
io.rest-assured : json-path jar 3.0.6
io.rest-assured : xml-path jar 3.0.6
io.rest-assured : json-schema-validator jar 3.0.6
commons-configuration : commons-configuration jar 1.10
commons-io : commons-io jar 2.5
com.google.code.findbugs : annotations jar 3.0.0
com.fasterxml.jackson.core : jackson-databind jar 2.10.0
com.fasterxml.jackson.core : jackson-core jar 2.10.0
com.fasterxml.jackson.core : jackson-annotations jar 2.10.0
org.apache.maven.plugins : maven-gpg-plugin maven-plugin 1.6

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Adobe Ride Logo



Speed the development of your automated REST API tests across microservices and end-to-end workflows.

Overview

Ride is a service-agnostic, modular, extensible Java REST API automation framework. It speeds test development by:

  • Abstracting repetitive code
  • Standardizing service-specific calls
  • Integrating testing across microservices and workflows
  • Auto Generating json payloads from schema
  • Auto-Fuzzing payloads defined by arbitrary json schemas
  • Running Perfomance tests against entire workflows without re-writing your test code

Current

Ride 2.0.0

Getting Started

While Ride can be used as is, it is more powerful when extended for your specific services. Extending it consists of three steps:

  • Providing config information, in the form of environment property files and payload schemas
  • Creating extensions from the core API Controller and ModelObject, which consume the config info you provide
  • Writing tests using the configured extension(s)

To begin to building your test extention, create a standard java project in the IDE/Build Tool of choice (the samples shown here are in Eclipse using Maven).

Configuration

With your base extension project created, provide Ride with the information discussed above on how to talk to your service:

  • Environment config files (*.properties) to target your service
  • JSON schemas which describe the payloads sent to the service

These should be placed in folders named as shown below in your project main resources (you may want to have a centralized, shareable resources jar - see samples):

Target Environments

Ride is designed so that multiple environments can be indicated, and multiple services for each environment can be defined. In the example below, 2 services are defined for localhost.properties (how to target them is discussed a bit further down). They will be consumed by your extension:

The advantage here is that if you have multiple services (even multiple extensions), you can run complete inter-service (end-to-end) flows targeting all service (using their respective test extensions) in one test.

Payload Definitions

Your service payloads are defined by standard json schema, and are organized into the services they target by folders as shown above.

Extending

Once you have your schemas and environment properties files setup, you can begin to create your extension. This is done by extending the ModelObject and extending the RestApiController

An examination of the pom files in those two sample projects will given you an idea of the dependencies you will need to identify in order to build and use your extension. You build your extension as you would any java project. Below is an example using Maven

Writing Tests

Once you have created and built your extension, you can begin using is tests which abstract away a significant portion repetitive code, as is shown below (the annotation is TestNG standard, built into Ride):

  @Test(groups = {"smoke", "acceptance"})
  public void testAuthenticatedCalltoServer() {
    String itemName = UUID.randomUUID().toString();

    // Create object
    SampleServiceObject1 testObject = new SampleServiceObject1(itemName, false);
    
    // Send object data to service
    SampleServiceController.createOrUpdateObject(testObject.getObjectPath(), testObject,
        ExpectedResponse.CREATED_RESPONSE, true);
  }

If you don't have Maven failsafe configured, it is recommended that you append your test file names with "_IT" so that they will be run by Failsafe as opposed to maven Surefire (for example, MyBasicTest_IT.java).

Running Your Tests

When you are ready to run your tests from the command line, below are a few examples of run commands (standard maven command line syntax):

#run all against prod01 environment
mvn clean verify -Dtarget=prod01
#run specific test
mvn clean verify -Dtarget=prod01 -Dit.test="myGreatTestFile_IT.java#creationTest
#run specific test group
mvn clean verify -Dtarget=prod01 -Dgroup=smoke

Fuzzing

With a few simple lines of code, you can generate different data type and content tests against the payload schema to see if your service handles each correctly. Ride internally maintains arrays of non-strings, SQL injection strings, No SQL injection strings, and localized strings to test against the definitions in your schema. The Fuzzer walks the entire hierarchy of any arbitrary schema and tests each node in isolation (sample code):

@Factory
  public Object[] fuzzObjectMetadata_IT() throws Exception {
    String itemName = UUID.randomUUID().toString();
    SampleServiceObject1 object1 = new SampleServiceObject1(itemName, false);
    return new Object[] {new MetadataFuzzer(Service.SAMPLE_SERVICE.toString(), object1)};
  }


Performance Testing

Part of the power of Ride is that once you have your extension written, you can use it for fuzzing (as shown above), but also for performance testing. The performance library in Ride is based on Gatling, so while there is a bit of setup, and a bit of a shift in syntax to scala, you are still able to setup tests that measure performance for full flows of data withough having to rewrite what you've already created in your extension - sample Ride performance test.

Additional Documentation

There are a number of supporting informational documents in this repo which will help you utilize and perhaps contribute to Ride.

com.adobe.ride

Adobe, Inc.

Open source from Adobe

Versions

Version
2.0.0
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3