redcape commented on code in PR #5508:
URL: https://github.com/apache/hadoop/pull/5508#discussion_r1146715092
##########
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:
was following the existing tests which seem to want to assert reference
equality a lot, I will change it for the new test.
--
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]