Package org.jclouds.sts.domain

Examples of org.jclouds.sts.domain.UserAndSessionCredentials


   }

   @Test
   protected void testAssumeRole() {
      String arnToAssume = getTestArn();
      UserAndSessionCredentials role = api.assumeRole(arnToAssume, "session",
            new AssumeRoleOptions().durationSeconds(MINUTES.toSeconds(15)));
      checkTemporaryCredentials(role.getCredentials());
      assertTrue(role.getUser().getId().contains("session"), role + " id incorrect");
      assertTrue(role.getUser().getArn().contains("session"), role + " arn incorrect");
      assertTrue(role.getPackedPolicySize() >= 0, role + " policy size negative");
   }
View Full Code Here


public class AssumeRoleResponseTest extends BaseHandlerTest {

   public void test() {
      InputStream is = getClass().getResourceAsStream("/assume_role.xml");

      UserAndSessionCredentials expected = expected();

      UserAndSessionCredentialsHandler handler = injector.getInstance(UserAndSessionCredentialsHandler.class);
      UserAndSessionCredentials result = factory.create(handler).parse(is);

      assertEquals(result, expected);
      assertEquals(result.getUser(), expected.getUser());
      assertEquals(result.getPackedPolicySize(), expected.getPackedPolicySize());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.sts.domain.UserAndSessionCredentials

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.