public void testTenantsByName() { TenantApi tenantApi = api.getTenantApi().get(); for (Tenant tenant : tenantApi.list().concat()) { Tenant aTenant = tenantApi.getByName(tenant.getName()); assertNotNull(aTenant, "get returned null for tenant: " + tenant); assertEquals(aTenant, tenant); } } }
public void testTenantsByName() { TenantApi tenantApi = api.getTenantApi().get(); for (Tenant tenant : tenantApi.list().concat()) { Tenant aTenant = tenantApi.getByName(tenant.getName()); assertNotNull(aTenant, "get returned null for tenant: " + tenant); assertEquals(aTenant, tenant); } } }
public void testGetTenantByNameFailNotFound() { TenantApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().endpoint(endpoint + "/v2.0/tenants?name=admin").build(), HttpResponse.builder().statusCode(404).build()).getTenantApi().get(); assertNull(api.getByName("admin")); }
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 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()); }