Package org.jclouds.hostedchef.domain

Examples of org.jclouds.hostedchef.domain.Group


      assertNotNull(groups);
      assertFalse(groups.isEmpty());
   }

   public void testGetUnexistingGroup() {
      Group group = api.getGroup(UUID.randomUUID().toString());
      assertNull(group);
   }
View Full Code Here


      assertNull(group);
   }

   public void testCreateGroup() {
      api.createGroup(GROUP_NAME);
      Group group = api.getGroup(GROUP_NAME);
      assertNotNull(group);
      assertEquals(group.getGroupname(), GROUP_NAME);
   }
View Full Code Here

      assertEquals(group.getGroupname(), GROUP_NAME);
   }

   @Test(dependsOnMethods = "testCreateGroup")
   public void testUpdateGroup() {
      Group group = api.getGroup(GROUP_NAME);
      group.setUsers(ImmutableSet.of(identity));
      group.setClients(ImmutableSet.of(ORG_NAME + "-validator"));

      api.updateGroup(group);
      group = api.getGroup(GROUP_NAME);

      assertNotNull(group);
      assertTrue(group.getUsers().contains(identity));
      assertTrue(group.getClients().contains(ORG_NAME + "-validator"));
   }
View Full Code Here

      assertTrue(group.getClients().contains(ORG_NAME + "-validator"));
   }

   @Test(expectedExceptions = ResourceNotFoundException.class)
   public void testUpdateUnexistingGroup() {
      api.updateGroup(new Group(UUID.randomUUID().toString()));
   }
View Full Code Here

   }

   @Test(dependsOnMethods = "testUpdateGroup")
   public void testDeleteGroup() {
      api.deleteGroup(GROUP_NAME);
      Group group = api.getGroup(GROUP_NAME);
      assertNull(group);
   }
View Full Code Here

                  .addHeader("Accept", MediaType.APPLICATION_JSON).build()), //
            HttpResponse.builder().statusCode(200)
                  .payload(payloadFromResourceWithContentType("/group.json", MediaType.APPLICATION_JSON)) //
                  .build());

      Group group = api.getGroup("admins");
      assertEquals(group.getName(), "admins");
      assertEquals(group.getGroupname(), "admins");
   }
View Full Code Here

            .addHeader("Accept", MediaType.APPLICATION_JSON) //
            .payload(payloadFromResourceWithContentType("/group-update.json", MediaType.APPLICATION_JSON)) //
            .build()), //
            HttpResponse.builder().statusCode(200).build());

      Group group = new Group("admins");
      group.setClients(ImmutableSet.of("abiquo"));
      group.setGroups(ImmutableSet.of("admins"));
      group.setUsers(ImmutableSet.of("nacx"));

      api.updateGroup(group);
   }
View Full Code Here

            .addHeader("Accept", MediaType.APPLICATION_JSON) //
            .payload(payloadFromResourceWithContentType("/group-update.json", MediaType.APPLICATION_JSON)) //
            .build()), //
            HttpResponse.builder().statusCode(404).build());

      Group group = new Group("admins");
      group.setClients(ImmutableSet.of("abiquo"));
      group.setGroups(ImmutableSet.of("admins"));
      group.setUsers(ImmutableSet.of("nacx"));

      api.updateGroup(group);
   }
View Full Code Here

      binder.bindToRequest(request, new Object());
   }

   public void testBindOnlyName() throws IOException {
      HttpRequest request = HttpRequest.builder().method("POST").endpoint(URI.create("http://localhost")).build();
      HttpRequest newRequest = binder.bindToRequest(request, new Group("foo"));

      String payload = Strings2.toStringAndClose(newRequest.getPayload().getInput());
      assertEquals(payload, "{\"groupname\":\"foo\",\"actors\":{\"clients\":[],\"groups\":[],\"users\":[]}}");
   }
View Full Code Here

      String payload = Strings2.toStringAndClose(newRequest.getPayload().getInput());
      assertEquals(payload, "{\"groupname\":\"foo\",\"actors\":{\"clients\":[],\"groups\":[],\"users\":[]}}");
   }

   public void testBindNameAndLists() throws IOException {
      Group group = new Group("foo");
      group.setClients(ImmutableSet.of("nacx-validator"));
      group.setGroups(ImmutableSet.of("admins"));
      group.setUsers(ImmutableSet.of("nacx"));

      HttpRequest request = HttpRequest.builder().method("POST").endpoint(URI.create("http://localhost")).build();
      HttpRequest newRequest = binder.bindToRequest(request, group);

      String payload = Strings2.toStringAndClose(newRequest.getPayload().getInput());
View Full Code Here

TOP

Related Classes of org.jclouds.hostedchef.domain.Group

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.