public void testTokenEndpoints() { TokenApi tokenApi = api.getTokenApi().get(); Set<? extends Endpoint> endpoints = tokenApi.listEndpointsForToken(token); assertNotNull(endpoints); assertFalse(endpoints.isEmpty()); }
public void testTokenEndpoints() { TokenApi tokenApi = api.getTokenApi().get(); Set<? extends Endpoint> endpoints = tokenApi.listEndpointsForToken(token); assertNotNull(endpoints); assertFalse(endpoints.isEmpty()); }
public void testInvalidTokenEndpoints() { TokenApi tokenApi = api.getTokenApi().get(); assertTrue(tokenApi.listEndpointsForToken("thisisnotarealtoken!").isEmpty()); } }
public void testInvalidTokenEndpoints() { TokenApi tokenApi = api.getTokenApi().get(); assertTrue(tokenApi.listEndpointsForToken("thisisnotarealtoken!").isEmpty()); } }
@Test public void testGetEndpointsForTokenFailNotFound() { TokenApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tokens/XXXXXX/endpoints").build(), HttpResponse.builder().statusCode(404).build()) .getTokenApi().get(); assertTrue(api.listEndpointsForToken("XXXXXX").isEmpty()); }
@Test public void testGetEndpointsForToken() { TokenApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tokens/XXXXXX/endpoints").build(), HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/user_endpoints.json", APPLICATION_JSON)).build()) .getTokenApi().get(); Set<? extends Endpoint> endpoints = api.listEndpointsForToken("XXXXXX"); assertEquals(endpoints, ImmutableSet.of( Endpoint.builder().publicURL(URI.create("https://csnode.jclouds.org/v2.0/")) .adminURL(URI.create("https://csnode.jclouds.org:35357/v2.0/")) .region("region-a.geo-1").id("2.0").versionId("2.0").build() )); }
@Test public void testGetEndpointsForToken() { TokenApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tokens/XXXXXX/endpoints").build(), HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/user_endpoints.json", APPLICATION_JSON)).build()) .getTokenApi().get(); Set<? extends Endpoint> endpoints = api.listEndpointsForToken("XXXXXX"); assertEquals(endpoints, ImmutableSet.of( Endpoint.builder().publicURL(URI.create("https://csnode.jclouds.org/v2.0/")) .adminURL(URI.create("https://csnode.jclouds.org:35357/v2.0/")) .region("region-a.geo-1").id("2.0").versionId("2.0").build() )); }