Package org.jclouds.dynect.v3.features

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


      return record;
   }

   private SOARecord checkSOARecord(SOARecord record) {
      checkNotNull(record.getSerialStyle(), "SerialStyle cannot be null for SOARecord: %s", record);
      SOAData rdata = record.getRData();
      checkNotNull(rdata.getMname(), "rdata.mname cannot be null for SOARecord: %s", record);
      checkNotNull(rdata.getRname(), "rdata.rname cannot be null for SOARecord: %s", record);
      checkNotNull(rdata.getSerial(), "rdata.serial cannot be null for SOARecord: %s", record);
      checkNotNull(rdata.getRefresh(), "rdata.refresh cannot be null for SOARecord: %s", record);
      checkNotNull(rdata.getRetry(), "rdata.retry cannot be null for SOARecord: %s", record);
      checkNotNull(rdata.getExpire(), "rdata.expire cannot be null for SOARecord: %s", record);
      checkNotNull(rdata.getMinimum(), "rdata.minimum cannot be null for SOARecord: %s", record);
      return record;
   }
View Full Code Here


      checkNotNull(rdata.getMinimum(), "rdata.minimum cannot be null for SOARecord: %s", record);
      return record;
   }

   private Record<SPFData> checkSPFRecord(Record<SPFData> record) {
      SPFData rdata = record.getRData();
      checkNotNull(rdata.getTxtdata(), "rdata.txtdata cannot be null for SPFRecord: %s", record);
      return record;
   }
View Full Code Here

      checkNotNull(rdata.getTxtdata(), "rdata.txtdata cannot be null for SPFRecord: %s", record);
      return record;
   }

   private Record<SRVData> checkSRVRecord(Record<SRVData> record) {
      SRVData rdata = record.getRData();
      checkNotNull(rdata.getPriority(), "rdata.priority cannot be null for SRVRecord: %s", record);
      checkNotNull(rdata.getWeight(), "rdata.weight cannot be null for SRVRecord: %s", record);
      checkNotNull(rdata.getPort(), "rdata.port cannot be null for SRVRecord: %s", record);
      checkNotNull(rdata.getTarget(), "rdata.target cannot be null for SRVRecord: %s", record);
      return record;
   }
View Full Code Here

      checkNotNull(rdata.getTarget(), "rdata.target cannot be null for SRVRecord: %s", record);
      return record;
   }

   private Record<SSHFPData> checkSSHFPRecord(Record<SSHFPData> record) {
      SSHFPData rdata = record.getRData();
      checkNotNull(rdata.getAlgorithm(), "rdata.algorithm cannot be null for SSHFPRecord: %s", record);
      checkNotNull(rdata.getType(), "rdata.type cannot be null for SSHFPRecord: %s", record);
      checkNotNull(rdata.getFingerprint(), "rdata.fingerprint cannot be null for SSHFPRecord: %s", record);
      return record;
   }
View Full Code Here

      checkNotNull(rdata.getFingerprint(), "rdata.fingerprint cannot be null for SSHFPRecord: %s", record);
      return record;
   }

   private Record<TXTData> checkTXTRecord(Record<TXTData> record) {
      TXTData rdata = record.getRData();
      checkNotNull(rdata.getTxtdata(), "rdata.txtdata cannot be null for TXTRecord: %s", record);
      return record;
   }
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).apply(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

   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

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.