@Test(dependsOnMethods = { "testCreateRole" }) public void testGetRole() { Role testGetRole = roleAdminOption.get().get(testRole.getId()); assertNotNull(testGetRole); assertEquals(testGetRole.getName(), "jclouds-test-role"); } }
public void testCreateRole() { testRole = roleAdminOption.get().create("jclouds-test-role"); assertTrue(retry(new Predicate<RoleAdminApi>() { public boolean apply(RoleAdminApi roleApi) { return roleApi.get(testRole.getId()) != null; } }, 180 * 1000L).apply(roleAdminOption.get())); assertEquals(roleAdminOption.get().get(testRole.getId()).getName(), "jclouds-test-role"); }
public T fromRole(Role in) { return this .id(in.getId()) .name(in.getName()) .description(in.getDescription()) .serviceId(in.getServiceId()) .tenantId(in.getTenantId()); } }
public T fromRole(Role in) { return this .id(in.getId()) .name(in.getName()) .description(in.getDescription()) .serviceId(in.getServiceId()) .tenantId(in.getTenantId()); } }
public T fromRole(Role in) { return this .id(in.getId()) .name(in.getName()) .description(in.getDescription()) .serviceId(in.getServiceId()) .tenantId(in.getTenantId()); } }
public T fromRole(Role in) { return this .id(in.getId()) .name(in.getName()) .description(in.getDescription()) .serviceId(in.getServiceId()) .tenantId(in.getTenantId()); } }
public T fromRole(Role in) { return this .id(in.getId()) .name(in.getName()) .description(in.getDescription()) .serviceId(in.getServiceId()) .tenantId(in.getTenantId()); } }
public T fromRole(Role in) { return this .id(in.getId()) .name(in.getName()) .description(in.getDescription()) .serviceId(in.getServiceId()) .tenantId(in.getTenantId()); } }
public T fromRole(Role in) { return this .id(in.getId()) .name(in.getName()) .description(in.getDescription()) .serviceId(in.getServiceId()) .tenantId(in.getTenantId()); } }
public void getRole() throws Exception { MockWebServer server = mockOpenStackServer(); server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access_version_uids.json")))); server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/admin_extensions.json")))); server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(200).setBody( stringFromResource("/role_create_response.json")))); try { KeystoneApi keystoneApi = api(server.getUrl("/").toString(), "openstack-keystone"); RoleAdminApi roleAdminApi = keystoneApi.getRoleAdminApi().get(); Role role = roleAdminApi.get("r1000"); assertEquals(server.getRequestCount(), 3); assertAuthentication(server); assertExtensions(server); RecordedRequest updateRoleRequest = server.takeRequest(); assertEquals(updateRoleRequest.getRequestLine(), "GET /OS-KSADM/roles/r1000 HTTP/1.1"); /* * Check response */ assertEquals(role.getId(), "r1000"); assertEquals(role.getName(), "jclouds-role"); } finally { server.shutdown(); } }