Examples of SessionApi


Examples of com.dyn.client.v3.traffic.features.SessionApi

   public void testConvertCredentialsParsesCustomer() {
      assertEquals(SessionManager.convert(new Credentials("customer:robbie", "password")), creds);
   }

   public void testCacheLoadLogsIn() {
      SessionApi sessionApi = createMock(SessionApi.class);
      expect(sessionApi.login(creds)).andReturn(session);
      replay(sessionApi);

      assertSame(SessionManager.buildCache(sessionApi).apply(creds), session);

      verify(sessionApi);
View Full Code Here

Examples of com.dyn.client.v3.traffic.features.SessionApi

   @Test
   public void testUnauthorizedShouldInvalidateSessionAndRetry() {
      HttpCommand command = createMock(HttpCommand.class);
      Supplier<Credentials> creds = createMock(Supplier.class);
      LoadingCache<Credentials, Session> sessionCache = createMock(LoadingCache.class);
      SessionApi sessionApi = createMock(SessionApi.class);

      sessionCache.invalidateAll();
      expectLastCall();
      expect(command.incrementFailureCount()).andReturn(1);
      expect(command.isReplayable()).andReturn(true);
View Full Code Here

Examples of com.dyn.client.v3.traffic.features.SessionApi

   @Test
   public void testIPMismatchShouldInvalidateSessionAndRetry() throws IOException {
      HttpCommand command = createMock(HttpCommand.class);
      Supplier<Credentials> creds = createMock(Supplier.class);
      LoadingCache<Credentials, Session> sessionCache = createMock(LoadingCache.class);
      SessionApi sessionApi = createMock(SessionApi.class);

      sessionCache.invalidateAll();
      expectLastCall();
      expect(command.incrementFailureCount()).andReturn(1);
      expect(command.isReplayable()).andReturn(true);
View Full Code Here

Examples of com.dyn.client.v3.traffic.features.SessionApi

   @Test
   public void testForbiddenShouldNotInvalidateSessionOrRetry() {
      HttpCommand command = createMock(HttpCommand.class);
      Supplier<Credentials> creds = createMock(Supplier.class);
      LoadingCache<Credentials, Session> sessionCache = createMock(LoadingCache.class);
      SessionApi sessionApi = createMock(SessionApi.class);

      replay(creds, sessionCache, sessionApi, command);

      HttpResponse response = HttpResponse.builder().statusCode(FORBIDDEN.getStatusCode()).build();
View Full Code Here

Examples of org.jclouds.cloudstack.features.SessionApi

    * with a different path separator.
    */
   @Test
   public void testWithDoubleDomainname() {
      LoginResponse response = createMock(LoginResponse.class);
      SessionApi client = createMock(SessionApi.class);

      expect(client.loginUserInDomainWithHashOfPassword(eq("User"), eq("Test/Domain"), (String) anyObject())).andReturn(response);
      replay(client);

      LoginWithPasswordCredentials obj = new LoginWithPasswordCredentials(client);
      Credentials cred = new Credentials("Test/Domain/User", "koffiedik");

View Full Code Here

Examples of org.jclouds.cloudstack.features.SessionApi

   }

   @Test
   public void testWithSingleDomainname() {
      LoginResponse response = createMock(LoginResponse.class);
      SessionApi client = createMock(SessionApi.class);

      expect(client.loginUserInDomainWithHashOfPassword(eq("User"), eq("Domain"), (String) anyObject())).andReturn(response);
      replay(client);

      LoginWithPasswordCredentials obj = new LoginWithPasswordCredentials(client);
      Credentials cred = new Credentials("Domain/User", "koffiedik");
View Full Code Here

Examples of org.jclouds.cloudstack.features.SessionApi

   }

   @Test
   public void testWithNoDomainname() {
       LoginResponse response = createMock(LoginResponse.class);
       SessionApi client = createMock(SessionApi.class);

       expect(client.loginUserInDomainWithHashOfPassword(eq("User"), eq(""), (String) anyObject())).andReturn(response);
       replay(client);

       LoginWithPasswordCredentials obj = new LoginWithPasswordCredentials(client);
       Credentials cred = new Credentials("User", "koffiedik");
View Full Code Here

Examples of org.jclouds.cloudstack.features.SessionApi

   @SuppressWarnings("unchecked")
   @Test
   public void test401ShouldRetryAndFailAfterFiveAttempts() {
      HttpCommand command = createMock(HttpCommand.class);
      SessionApi sessionClient = createMock(SessionApi.class);
      LoadingCache<Credentials, LoginResponse> cache = createMock(LoadingCache.class);

      cache.invalidateAll();
      expectLastCall().anyTimes();
View Full Code Here

Examples of org.jclouds.cloudstack.features.SessionApi

   @SuppressWarnings("unchecked")
   @Test
   public void test401ShouldRetryAndFailAfterFiveAttempts() {
      HttpCommand command = createMock(HttpCommand.class);
      SessionApi sessionClient = createMock(SessionApi.class);
      LoadingCache<Credentials, LoginResponse> cache = createMock(LoadingCache.class);

      cache.invalidateAll();
      expectLastCall().anyTimes();
View Full Code Here

Examples of org.jclouds.dynect.v3.features.SessionApi

   public void testConvertCredentialsParsesCustomer() {
      assertEquals(SessionManager.convert(new Credentials("customer:robbie", "password")), creds);
   }

   public void testCacheLoadLogsIn() {
      SessionApi sessionApi = createMock(SessionApi.class);
      expect(sessionApi.login(creds)).andReturn(session);
      replay(sessionApi);

      assertSame(SessionManager.buildCache(sessionApi).apply(creds), session);

      verify(sessionApi);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.