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

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


               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());
   }
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").enabled(true).
            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

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

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

   public void testToken() {

      TokenApi tokenApi = api.getTokenApi().get();
      assertTrue(tokenApi.isValid(token));
      Token result = tokenApi.get(token);
      assertNotNull(result);
      assertEquals(result.getId(), token);
      assertNotNull(result.getTenant());

      User user = tokenApi.getUserOfToken(token);
      assertNotNull(user);
      assertNotNull(user.getId());
      assertNotNull(user.getName());
View Full Code Here

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

   public void testToken() {

      TokenApi tokenApi = api.getTokenApi().get();
      assertTrue(tokenApi.isValid(token));
      Token result = tokenApi.get(token);
      assertNotNull(result);
      assertEquals(result.getId(), token);
      assertNotNull(result.getTenant());

      User user = tokenApi.getUserOfToken(token);
      assertNotNull(user);
      assertNotNull(user.getId());
      assertNotNull(user.getName());
View Full Code Here

      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();
      User user = api.getUserOfToken("sometokenorother");
      assertNotNull(user);
      assertEquals(user, User.builder().id("2b9b606181634ae9ac86fd95a8bc2cde").name("admin")
            .roles(ImmutableSet.of(Role.builder().id("79cada5c02814b57a52e0eed4dd388cb").name("admin").build()))
            .build());
   }
View Full Code Here

TOP

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

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.