Package com.dyn.client.v3.traffic.domain.RecordSet

Examples of com.dyn.client.v3.traffic.domain.RecordSet.Value


   }

   @Test
   protected void testListAndGetRecords() {
      for (String zone : zoneApi().list()) {
         RecordApi api = api(zone);
         ImmutableList<RecordId> records = api.list().toList();
         getAnonymousLogger().info("zone: " + zone + " record count: " + records.size());

         for (RecordId recordId : records) {
            Record<? extends Map<String, Object>> record;
            if ("AAAA".equals(recordId.getType())) {
               record = checkAAAARecord(api.getAAAA(recordId.getFQDN(), recordId.getId()));
            } else if ("A".equals(recordId.getType())) {
               record = checkARecord(api.getA(recordId.getFQDN(), recordId.getId()));
            } else if ("CNAME".equals(recordId.getType())) {
               record = checkCNAMERecord(api.getCNAME(recordId.getFQDN(), recordId.getId()));
            } else if ("MX".equals(recordId.getType())) {
               record = checkMXRecord(api.getMX(recordId.getFQDN(), recordId.getId()));
            } else if ("NS".equals(recordId.getType())) {
               record = checkNSRecord(api.getNS(recordId.getFQDN(), recordId.getId()));
            } else if ("PTR".equals(recordId.getType())) {
               record = checkPTRRecord(api.getPTR(recordId.getFQDN(), recordId.getId()));
            } else if ("SOA".equals(recordId.getType())) {
               record = checkSOARecord(api.getSOA(recordId.getFQDN(), recordId.getId()));
            } else if ("SPF".equals(recordId.getType())) {
               record = checkSPFRecord(api.getSPF(recordId.getFQDN(), recordId.getId()));
            } else if ("SRV".equals(recordId.getType())) {
               record = checkSRVRecord(api.getSRV(recordId.getFQDN(), recordId.getId()));
            } else if ("SSHFP".equals(recordId.getType())) {
               record = checkSSHFPRecord(api.getSSHFP(recordId.getFQDN(), recordId.getId()));
            } else if ("TXT".equals(recordId.getType())) {
               record = checkTXTRecord(api.getTXT(recordId.getFQDN(), recordId.getId()));
            } else {
               record = api.get(recordId);
            }
            assertEquals(record, recordId);
            checkRecord(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

      replay(creds, sessionCache, sessionApi, command);

      HttpResponse response = HttpResponse.builder().statusCode(UNAUTHORIZED.getStatusCode()).build();

      SessionManager retry = new SessionManager(creds, sessionCache, sessionApi);

      assertTrue(retry.shouldRetryRequest(command, response));

      verify(creds, sessionCache, sessionApi, command);
   }
View Full Code Here

      HttpResponse response = HttpResponse.builder()
                                          .statusCode(BAD_REQUEST.getStatusCode())
                                          .payload(getResource("ip_mismatch.json").openStream())
                                          .build();

      SessionManager retry = new SessionManager(creds, sessionCache, sessionApi);

      assertTrue(retry.shouldRetryRequest(command, response));

      verify(creds, sessionCache, sessionApi, command);
   }
View Full Code Here

      replay(creds, sessionCache, sessionApi, command);

      HttpResponse response = HttpResponse.builder().statusCode(FORBIDDEN.getStatusCode()).build();

      SessionManager retry = new SessionManager(creds, sessionCache, sessionApi);

      assertFalse(retry.shouldRetryRequest(command, response));

      verify(creds, sessionCache, sessionApi, command);
   }
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

TOP

Related Classes of com.dyn.client.v3.traffic.domain.RecordSet.Value

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.