Package org.jclouds.chef.domain

Examples of org.jclouds.chef.domain.Role$Builder


   @Test
   public void testCreateRole() throws Exception {
      api.deleteRole(PREFIX);
      api.createRole(Role.builder().name(PREFIX).runListElement("recipe[java]").build());
      Role role = api.getRole(PREFIX);
      assertNotNull(role, "Created role should not be null");
      assertEquals(role.getName(), PREFIX);
      assertEquals(role.getRunList(), Collections.singleton("recipe[java]"));
   }
View Full Code Here


   }

   @Test(dependsOnMethods = "testCreateRole")
   public void testUpdateRole() throws Exception {
      for (String rolename : api.listRoles()) {
         Role role = api.getRole(rolename);
         api.updateRole(role);
      }
   }
View Full Code Here

   @Test
   public void testCreateRole() throws Exception {
      api.deleteRole(PREFIX);
      api.createRole(Role.builder().name(PREFIX).runListElement("recipe[java]").build());
      Role role = api.getRole(PREFIX);
      assertNotNull(role, "Created role should not be null");
      assertEquals(role.getName(), PREFIX);
      assertEquals(role.getRunList(), Collections.singleton("recipe[java]"));
   }
View Full Code Here

   }

   @Test(dependsOnMethods = "testCreateRole")
   public void testUpdateRole() throws Exception {
      for (String rolename : api.listRoles()) {
         Role role = api.getRole(rolename);
         api.updateRole(role);
      }
   }
View Full Code Here

   }

   public void testCreateRole() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(ChefApi.class, "createRole", Role.class);
      GeneratedHttpRequest httpRequest = processor.apply(Invocation.create(method,
            ImmutableList.<Object> of(new Role("testrole", ImmutableSet.of("recipe[java]")))));

      assertRequestLineEquals(httpRequest, "POST http://localhost:4000/roles HTTP/1.1");
      assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\nX-Chef-Version: " + ChefApi.VERSION
            + "-test\n");
      assertPayloadEquals(httpRequest, "{\"name\":\"testrole\",\"override_attributes\":{},\"default_attributes\":{},"
View Full Code Here

   }

   public void testUpdateRole() throws SecurityException, NoSuchMethodException, IOException {
      Invokable<?, ?> method = method(ChefApi.class, "updateRole", Role.class);
      GeneratedHttpRequest httpRequest = processor.apply(Invocation.create(method,
            ImmutableList.<Object> of(new Role("testrole", ImmutableSet.of("recipe[java]")))));

      assertRequestLineEquals(httpRequest, "PUT http://localhost:4000/roles/testrole HTTP/1.1");
      assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\nX-Chef-Version: " + ChefApi.VERSION
            + "-test\n");
      assertPayloadEquals(httpRequest, "{\"name\":\"testrole\",\"override_attributes\":{},\"default_attributes\":{},"
View Full Code Here

   }

   @Test
   public void testCreateRole() throws Exception {
      api.deleteRole(PREFIX);
      api.createRole(new Role(PREFIX, Collections.singleton("recipe[java]")));
      role = api.getRole(PREFIX);
      assertNotNull(role);
      assertEquals(role.getName(), PREFIX);
      assertEquals(role.getRunList(), Collections.singleton("recipe[java]"));
   }
View Full Code Here

   }

   @Test(dependsOnMethods = "testRoleExists")
   public void testUpdateRole() throws Exception {
      for (String rolename : api.listRoles()) {
         Role role = api.getRole(rolename);
         api.updateRole(role);
      }
   }
View Full Code Here

   @Test
   public void testCreateRole() throws Exception {
      api.deleteRole(PREFIX);
      api.createRole(Role.builder().name(PREFIX).runListElement("recipe[java]").build());
      Role role = api.getRole(PREFIX);
      assertNotNull(role, "Created role should not be null");
      assertEquals(role.getName(), PREFIX);
      assertEquals(role.getRunList(), Collections.singleton("recipe[java]"));
   }
View Full Code Here

   }

   @Test(dependsOnMethods = "testCreateRole")
   public void testUpdateRole() throws Exception {
      for (String rolename : api.listRoles()) {
         Role role = api.getRole(rolename);
         api.updateRole(role);
      }
   }
View Full Code Here

TOP

Related Classes of org.jclouds.chef.domain.Role$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.