Skip to content

Commit

Permalink
Merge pull request #33 from akamai/feature/32
Browse files Browse the repository at this point in the history
Feature/32
  • Loading branch information
elreydetodo authored Aug 24, 2018
2 parents 0d79e95 + f74bd48 commit cbcb5fc
Show file tree
Hide file tree
Showing 15 changed files with 83 additions and 21 deletions.
2 changes: 1 addition & 1 deletion edgegrid-signer-apache-http-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Include the following Maven dependency in your project POM:
<dependency>
<groupId>com.akamai.edgegrid</groupId>
<artifactId>edgegrid-signer-apache-http-client</artifactId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion edgegrid-signer-apache-http-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>edgegrid-signer-parent</artifactId>
<groupId>com.akamai.edgegrid</groupId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion edgegrid-signer-async-http-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Include the following Maven dependency in your project POM:
<dependency>
<groupId>com.akamai.edgegrid</groupId>
<artifactId>edgegrid-signer-async-http-client</artifactId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion edgegrid-signer-async-http-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>edgegrid-signer-parent</artifactId>
<groupId>com.akamai.edgegrid</groupId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion edgegrid-signer-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>edgegrid-signer-parent</artifactId>
<groupId>com.akamai.edgegrid</groupId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>
</parent>

<artifactId>edgegrid-signer-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edgegrid-signer-gatling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Include the following Maven dependency in your project POM:
<dependency>
<groupId>com.akamai.edgegrid</groupId>
<artifactId>edgegrid-signer-gatling</artifactId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>
</dependency>
```

Expand Down
15 changes: 14 additions & 1 deletion edgegrid-signer-gatling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>edgegrid-signer-parent</artifactId>
<groupId>com.akamai.edgegrid</groupId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>
</parent>

<artifactId>edgegrid-signer-gatling</artifactId>
Expand All @@ -32,6 +32,10 @@
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -61,7 +65,16 @@
<version>2.2.4</version>
<configuration>
<runMultipleSimulations>true</runMultipleSimulations>
<disableCompiler>true</disableCompiler>
</configuration>
<executions>
<execution>
<id>gatling-integration-tests</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,46 @@
package com.akamai.edgegrid.signer.gatling

import com.akamai.edgegrid.signer.ahc.AsyncHttpClientEdgeGridSignatureCalculator
import com.github.tomakehurst.wiremock.WireMockServer
import com.github.tomakehurst.wiremock.client.WireMock._
import com.github.tomakehurst.wiremock.core.WireMockConfiguration
import io.gatling.core.Predef._
import io.gatling.http.Predef._


class EdgeGridSignerSimulation1 extends Simulation {

val httpConf = http
.baseURL("http://localhost")
.baseURL("http://" + testdata.SERVICE_MOCK_HOST)

val wireMockServer = new WireMockServer(WireMockConfiguration.wireMockConfig().port(testdata.SERVICE_MOCK_PORT))

val testScenario = scenario("Test scenario")
.exec(
http("fakeRequest")
.get("/test")
.signatureCalculator(new AsyncHttpClientEdgeGridSignatureCalculator(testdata.testCredential))
.check(status.is(201))
)

before {
wireMockServer.start()
wireMockServer.stubFor(get(urlPathEqualTo("/test"))
.withHeader("Authorization", matching(".*"))
.withHeader("Host", equalTo(testdata.SERVICE_MOCK))
.willReturn(aResponse.withStatus(201)
.withHeader("Content-Type", "text/xml")
.withBody("<response>Some content</response>")))
}

setUp(testScenario.inject(atOnceUsers(1)))
.protocols(httpConf)
.assertions(
global.successfulRequests.percent.is(100)
)

setUp(
testScenario.inject(atOnceUsers(1))
).protocols(httpConf)
after {
wireMockServer.stop()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,44 @@
package com.akamai.edgegrid.signer.gatling

import com.akamai.edgegrid.signer.ahc.AsyncHttpClientEdgeGridSignatureCalculator
import com.github.tomakehurst.wiremock.WireMockServer
import com.github.tomakehurst.wiremock.client.WireMock._
import com.github.tomakehurst.wiremock.core.WireMockConfiguration
import io.gatling.core.Predef._
import io.gatling.http.Predef._

class EdgeGridSignerSimulation2 extends Simulation{
class EdgeGridSignerSimulation2 extends Simulation {

val httpConf = http

val wireMockServer = new WireMockServer(WireMockConfiguration.wireMockConfig().port(testdata.SERVICE_MOCK_PORT))

val testScenario = scenario("Test scenario")
.exec(
http("fakeRequest")
.get("https://" + testdata.testCredential.getHost + "/test")
.get("http://" + testdata.testCredential.getHost + "/test")
.signatureCalculator(new AsyncHttpClientEdgeGridSignatureCalculator(testdata.testCredential))
)

setUp(
testScenario.inject(atOnceUsers(1))
).protocols(httpConf)
before {
wireMockServer.start()
wireMockServer.stubFor(get(urlPathEqualTo("/test"))
.withHeader("Authorization", matching(".*"))
.withHeader("Host", equalTo(testdata.SERVICE_MOCK))
.willReturn(aResponse.withStatus(201)
.withHeader("Content-Type", "text/xml")
.withBody("<response>Some content</response>")))
}

setUp(testScenario.inject(atOnceUsers(1)))
.protocols(httpConf)
.assertions(
global.successfulRequests.percent.is(100)
)

after {
wireMockServer.stop()
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ package object testdata {
.clientSecret("SOMESECRET")
.host("localhost:9089").build

val SERVICE_MOCK_HOST = "localhost"
val SERVICE_MOCK_PORT = 9089
val SERVICE_MOCK = testdata.SERVICE_MOCK_HOST + ":" + testdata.SERVICE_MOCK_PORT


}
2 changes: 1 addition & 1 deletion edgegrid-signer-google-http-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Include the following Maven dependency in your project POM:
<dependency>
<groupId>com.akamai.edgegrid</groupId>
<artifactId>edgegrid-signer-google-http-client</artifactId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion edgegrid-signer-google-http-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>edgegrid-signer-parent</artifactId>
<groupId>com.akamai.edgegrid</groupId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>
</parent>

<artifactId>edgegrid-signer-google-http-client</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion edgegrid-signer-rest-assured/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Include the following Maven dependency in your project POM:
<dependency>
<groupId>com.akamai.edgegrid</groupId>
<artifactId>edgegrid-signer-rest-assured</artifactId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion edgegrid-signer-rest-assured/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>edgegrid-signer-parent</artifactId>
<groupId>com.akamai.edgegrid</groupId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>
</parent>

<artifactId>edgegrid-signer-rest-assured</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.akamai.edgegrid</groupId>
<artifactId>edgegrid-signer-parent</artifactId>
<version>3.0.0</version>
<version>3.0.1-SNAPSHOT</version>

<modules>
<module>edgegrid-signer-apache-http-client</module>
Expand Down

0 comments on commit cbcb5fc

Please sign in to comment.