Package org.jclouds.openstack.keystone.v2_0.domain

Examples of org.jclouds.openstack.keystone.v2_0.domain.Tenant


            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();
      }
   }
View Full Code Here


      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404)));

      try {
         KeystoneApi keystoneApi = api(server.getUrl("/").toString(), "openstack-keystone");
         RoleAdminApi roleAdminApi = keystoneApi.getRoleAdminApi().get();
         Role role = roleAdminApi.get("r1000");

         assertNull(role);
         assertEquals(server.getRequestCount(), 3);
         assertAuthentication(server);
         assertExtensions(server);
View Full Code Here

      ServiceAdminApi serviceApi = serviceAdminOption.get();
      Set<? extends Service> services = serviceApi.list().concat().toSet();
      assertNotNull(services);
      assertFalse(services.isEmpty());
      for (Service service : services) {
         Service aService = serviceApi.get(service.getId());
         assertEquals(aService, service);
      }

   }
View Full Code Here

      assertEquals(serviceAdminOption.get().get(testService.getId()).getName(), "jclouds-test-service");
   }

   @Test(dependsOnMethods = { "testCreateService" })
   public void testGetService() {
      Service testGetService = serviceAdminOption.get().get(testService.getId());
      assertNotNull(testGetService);
      assertEquals(testGetService.getName(), "jclouds-test-service");

   }
View Full Code Here

               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());
   }
View Full Code Here

               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());
   }
View Full Code Here

               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());
   }
View Full Code Here

               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());
   }
View Full Code Here

      assertFalse(result.isEmpty());

      for (Tenant tenant : result) {
         assertNotNull(tenant.getId());

         Tenant aTenant = tenantApi.get(tenant.getId());
         assertNotNull(aTenant, "get returned null for tenant: " + tenant);

         assertEquals(aTenant, tenant);
      }
   }
View Full Code Here

   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);
      }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.keystone.v2_0.domain.Tenant

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.