@Test(enabled = false) public void testListTenantsATT() { TenantApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tenants").build(), HttpResponse.builder().statusCode(200).payload( payloadFromResourceWithContentType("/tenant_list_att.json", APPLICATION_JSON)).build()) .getTenantApi().get(); Set<Tenant> expected = ImmutableSet.of(Tenant.builder().name("this-is-a-test").id("14").description("None").build()); assertEquals(api.list().concat().toSet(), expected); }
@Test(enabled = false) public void testListTenantsATT() { TenantApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tenants").build(), HttpResponse.builder().statusCode(200).payload( payloadFromResourceWithContentType("/tenant_list_att.json", APPLICATION_JSON)).build()) .getTenantApi().get(); Set<Tenant> expected = ImmutableSet.of(Tenant.builder().name("this-is-a-test").id("14").description("None").build()); assertEquals(api.list().concat().toSet(), expected); }
public void testListTenants() { ServiceApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tenants").build(), HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/tenant_list.json", APPLICATION_JSON)).build()) .getServiceApi(); Set<? extends Tenant> tenants = api.listTenants(); assertNotNull(tenants); assertFalse(tenants.isEmpty()); Set<Tenant> expected = ImmutableSet.of(Tenant.builder().name("demo").id("05d1dc7af71646deba64cfc17b81bec0") .build(), Tenant.builder().name("admin").id("7aa2e17ec29f44d193c48feaba0852cc").build()); assertEquals(tenants, expected); }
.expires(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-08-01T13:08:52Z")) .id("946b8ad1ede4422f87ab21dcba27896d") .tenant(Tenant.builder().id("2fdc88ae152948c690b97ba307acae9b").name("admin") .enabled(true).build()).build()) .user(User.builder()
.tenant(Tenant.builder() .id("82d8d2f865484776a1daf1e2245d3317") .name("demo").build()).build()) .service(Service.builder().type("compute").name("nova")
.expires(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-08-01T13:08:52Z")) .id("946b8ad1ede4422f87ab21dcba27896d") .tenant(Tenant.builder().id("2fdc88ae152948c690b97ba307acae9b").name("admin").build()).build()) .user(User.builder() .id("b4d134cfe3cf43ad8ba0c2fc5b5d8f91")
public void testListTenants() { ServiceApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tenants").build(), HttpResponse.builder().statusCode(200) .payload(payloadFromResourceWithContentType("/tenant_list.json", APPLICATION_JSON)).build()) .getServiceApi(); Set<? extends Tenant> tenants = api.listTenants(); assertNotNull(tenants); assertFalse(tenants.isEmpty()); Set<Tenant> expected = ImmutableSet.of(Tenant.builder().name("demo").id("05d1dc7af71646deba64cfc17b81bec0") .enabled(true).build(), Tenant.builder().name("admin").id("7aa2e17ec29f44d193c48feaba0852cc") .enabled(true).build()); assertEquals(tenants, expected); }
public void testGetTenantByName() { TenantApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tenants?name=admin").build(), HttpResponse.builder().statusCode(200).payload( payloadFromResourceWithContentType("/tenant_details.json", APPLICATION_JSON)).build()) .getTenantApi().get(); Tenant tenant = api.getByName("admin"); assertNotNull(tenant); assertEquals(tenant, Tenant.builder().id("013ba41150a14830bec85ffe93353bcc").name("admin").enabled(true). build()); }
public void testGetTenant() { TenantApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tenants/013ba41150a14830bec85ffe93353bcc").build(), HttpResponse.builder().statusCode(200).payload( payloadFromResourceWithContentType("/tenant_details.json", APPLICATION_JSON)).build()) .getTenantApi().get(); Tenant tenant = api.get("013ba41150a14830bec85ffe93353bcc"); assertNotNull(tenant); assertEquals(tenant, Tenant.builder().id("013ba41150a14830bec85ffe93353bcc").name("admin").enabled(true). build()); }
public T fromTenant(Tenant in) { return this.id(in.getId()).name(in.getName()).description(in.getDescription()); } }
public T fromTenant(Tenant in) { return this.id(in.getId()).name(in.getName()).description(in.getDescription()); } }
public T fromTenant(Tenant in) { return this.id(in.getId()).name(in.getName()).description(in.getDescription()); } }
public void testGetToken() { TokenApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tokens/sometokenorother").build(), HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/token_details.json", APPLICATION_JSON)).build()) .getTokenApi().get(); Token token = api.get("sometokenorother"); assertNotNull(token); assertEquals(token, Token.builder().id("167eccdc790946969ced473732e8109b").expires(dateService.iso8601SecondsDateParse("2012-04-28T12:42:50Z")) .tenant(Tenant.builder().id("4cea93f5464b4f1c921fb3e0461d72b5").name("demo").enabled(true).build()).build()); }
public T fromTenant(Tenant in) { return this.id(in.getId()).name(in.getName()).description(in.getDescription()); } }
public T fromTenant(Tenant in) { return this .id(in.getId()) .name(in.getName()) .description(in.getDescription()); } }
public T fromTenant(Tenant in) { return this .id(in.getId()) .name(in.getName()) .description(in.getDescription()); } }
public void testGetTenant() { TenantApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tenants/013ba41150a14830bec85ffe93353bcc").build(), HttpResponse.builder().statusCode(200).payload( payloadFromResourceWithContentType("/tenant_details.json", APPLICATION_JSON)).build()) .getTenantApi().get(); Tenant tenant = api.get("013ba41150a14830bec85ffe93353bcc"); assertNotNull(tenant); assertEquals(tenant, Tenant.builder().id("013ba41150a14830bec85ffe93353bcc").name("admin").build()); }
public T fromTenant(Tenant in) { return this .id(in.getId()) .name(in.getName()) .description(in.getDescription()); } }
public void testGetTenantByName() { TenantApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tenants?name=admin").build(), HttpResponse.builder().statusCode(200).payload( payloadFromResourceWithContentType("/tenant_details.json", APPLICATION_JSON)).build()) .getTenantApi().get(); Tenant tenant = api.getByName("admin"); assertNotNull(tenant); assertEquals(tenant, Tenant.builder().id("013ba41150a14830bec85ffe93353bcc").name("admin").build()); }
public void testGetToken() { TokenApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tokens/sometokenorother").build(), HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/token_details.json", APPLICATION_JSON)).build()) .getTokenApi().get(); Token token = api.get("sometokenorother"); assertNotNull(token); assertEquals(token, Token.builder().id("167eccdc790946969ced473732e8109b").expires(dateService.iso8601SecondsDateParse("2012-04-28T12:42:50Z")) .tenant(Tenant.builder().id("4cea93f5464b4f1c921fb3e0461d72b5").name("demo").build()).build()); }