Package org.jclouds.dynect.v3.features

Examples of org.jclouds.dynect.v3.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


   @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

   @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

   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).getUnchecked(creds), session);

      verify(sessionApi);
View Full Code Here

   @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

   @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

   @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

   // TODO: currently our parsing of annotations on expected() ignores
   // @Transform
   @Override
   protected Function<HttpResponse, FluentIterable<String>> parser(Injector i) {
      return compose(new ExtractLastPathComponent(), super.parser(i));
   }
View Full Code Here

   // TODO: currently our parsing of annotations on expected() ignores
   // @Transform
   @Override
   protected Function<HttpResponse, FluentIterable<String>> parser(Injector i) {
      return compose(new ExtractLastPathComponent(), super.parser(i));
   }
View Full Code Here

         .payload(payloadFromResourceWithContentType("/delete_zone_changes.json", APPLICATION_JSON)).build();

   public void testDeleteChangesWhenResponseIs2xx() {
      DynECTApi success = requestsSendResponses(createSession, createSessionResponse, deleteChanges, deleteChangesResponse);
      assertEquals(success.getZoneApi().deleteChanges("jclouds.org").toString(),
                   new DeleteZoneChangesResponseTest().expected().toString());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.dynect.v3.features.SessionApi

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.