diff options
Diffstat (limited to 'cloudify-client/src/test/java/org/onap/so/cloudify/base/client/CloudifyClientTokenProviderTest.java')
-rw-r--r-- | cloudify-client/src/test/java/org/onap/so/cloudify/base/client/CloudifyClientTokenProviderTest.java | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/cloudify-client/src/test/java/org/onap/so/cloudify/base/client/CloudifyClientTokenProviderTest.java b/cloudify-client/src/test/java/org/onap/so/cloudify/base/client/CloudifyClientTokenProviderTest.java index ba43dc9e78..77152a2dd0 100644 --- a/cloudify-client/src/test/java/org/onap/so/cloudify/base/client/CloudifyClientTokenProviderTest.java +++ b/cloudify-client/src/test/java/org/onap/so/cloudify/base/client/CloudifyClientTokenProviderTest.java @@ -25,32 +25,32 @@ import static com.github.tomakehurst.wiremock.client.WireMock.get; import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; import static org.junit.Assert.assertEquals; - import org.apache.http.HttpStatus; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; - import com.github.tomakehurst.wiremock.junit.WireMockRule; public class CloudifyClientTokenProviderTest { - @Rule - public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); - - @Rule - public ExpectedException thrown = ExpectedException.none(); + @Rule + public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); + + @Rule + public ExpectedException thrown = ExpectedException.none(); - @Test - public void createTokenProvider() { - wireMockRule.stubFor(get(urlPathEqualTo("/testUrl/api/v3/tokens")).willReturn(aResponse() - .withHeader("Content-Type", "application/json").withBody("{\"role\": \"user\", \"value\": \"tokenVal\"}").withStatus(HttpStatus.SC_OK))); - int port = wireMockRule.port(); + @Test + public void createTokenProvider() { + wireMockRule.stubFor(get(urlPathEqualTo("/testUrl/api/v3/tokens")) + .willReturn(aResponse().withHeader("Content-Type", "application/json") + .withBody("{\"role\": \"user\", \"value\": \"tokenVal\"}").withStatus(HttpStatus.SC_OK))); + int port = wireMockRule.port(); - CloudifyClientTokenProvider cctp = new CloudifyClientTokenProvider("http://localhost:"+port+"/testUrl", "user", "pswd"); - String token = cctp.getToken(); - assertEquals("tokenVal", token); - token = cctp.getToken(); - assertEquals("tokenVal", token); - cctp.expireToken(); - } + CloudifyClientTokenProvider cctp = + new CloudifyClientTokenProvider("http://localhost:" + port + "/testUrl", "user", "pswd"); + String token = cctp.getToken(); + assertEquals("tokenVal", token); + token = cctp.getToken(); + assertEquals("tokenVal", token); + cctp.expireToken(); + } } |