Skip to content

Commit

Permalink
Refactored the wiremock tests to be more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Feb 23, 2017
1 parent 6ace3f3 commit 9a85cc2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package net.serenitybdd.rest.configuring

class NextAvailablePort {
static int number() {
ServerSocket serverSocket = new ServerSocket(0);
return serverSocket.getLocalPort();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class WhenConfiguringAuthHTTPSRequestParameters extends Specification {

@Rule
def WireMockRule wire = new WireMockRule(wireMockConfig()
.httpsPort(0)
.httpsPort(NextAvailablePort.number())
.keystorePath(FileSystemUtils.getResourceAsFile("wiremock/keystore.jks").getAbsolutePath())
.keystorePassword("serenitybdd"));

Expand Down

0 comments on commit 9a85cc2

Please sign in to comment.