Examples of exportCache()


Examples of org.iplantc.agave.client.model.AccessToken.exportCache()

      Assert.assertFalse(StringUtils.isEmpty(token.getAccessToken()), "Null access token string from API");
      Assert.assertFalse(StringUtils.isEmpty(token.getRefreshToken()), "Null refresh token string from API");
      Assert.assertTrue(token.getCreatedAt().isBeforeNow(), "Token creation time was not in the past.");
      Assert.assertTrue(token.getExpiresAt().isAfterNow(), "Token creation time was not in the past.");
   
      token.exportCache(Settings.AUTH_CACHE_FILE);
      Assert.assertTrue(Settings.AUTH_CACHE_FILE.exists(), "Cache file does not exist.");
     
      JsonNode json = JsonUtil.getJsonMapper().readTree(Settings.AUTH_CACHE_FILE);
     
      Assert.assertEquals(json.get("access_token").asText(), token.getAccessToken(),
View Full Code Here

Examples of org.iplantc.agave.client.model.AccessToken.exportCache()

      Assert.assertFalse(StringUtils.isEmpty(token.getAccessToken()), "Null access token string from API");
      Assert.assertFalse(StringUtils.isEmpty(token.getRefreshToken()), "Null refresh token string from API");
      Assert.assertTrue(token.getCreatedAt().isBeforeNow(), "Token creation time was not in the past.");
      Assert.assertTrue(token.getExpiresAt().isAfterNow(), "Token creation time was not in the past.");
   
      token.exportCache(Settings.AUTH_CACHE_FILE);
      Assert.assertTrue(Settings.AUTH_CACHE_FILE.exists(), "Cache file does not exist.");
     
      JsonNode json = JsonUtil.getJsonMapper().readTree(Settings.AUTH_CACHE_FILE);
      Assert.assertEquals(json.get("access_token").asText(), token.getAccessToken(),
          "Access token saved does not match that returned from the API");
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.