steveloughran commented on code in PR #5508:
URL: https://github.com/apache/hadoop/pull/5508#discussion_r1149159845


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/utils/TestCachedSASToken.java:
##########
@@ -78,6 +78,31 @@ public void testUpdateAndGet() throws IOException {
     Assert.assertTrue(token3 == cachedToken);
   }
 
+  @Test
+  public void testValidExpirationParsing() {
+    CachedSASToken cachedSasToken = new CachedSASToken();
+    String[] values = {
+      "2123-03-24T00:06:46Z", // sample timestamp from azure portal
+      "2124-03-30", // sample YYYY-MM-DD date format generated from az cli
+      "2125-03-30Z", // sample YYYY-MM-DD[offset] date format
+    };
+
+    for (String se : values) {
+      cachedSasToken.setForTesting(null, null);
+      String token = "se=" + se;
+
+      // set first time and ensure reference equality
+      cachedSasToken.update(token);
+      String cachedToken = cachedSasToken.get();
+      Assert.assertTrue(token == cachedToken);

Review Comment:
   yeah, old code...just because it was done that way doesn't mean we should 
carry on



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to