File tree 1 file changed +2
-3
lines changed
src/test/java/org/jenkinsci/plugins/kubernetes/credentials
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -96,13 +96,12 @@ public void testBadLocation() throws IOException {
96
96
}
97
97
98
98
@ Test
99
- public void testValidTokenExtraction () throws OpenShiftBearerTokenCredentialImpl .TokenResponseError {
99
+ public void testTokenExtractionEarlyExpire () throws OpenShiftBearerTokenCredentialImpl .TokenResponseError {
100
100
OpenShiftBearerTokenCredentialImpl .Token token = OpenShiftBearerTokenCredentialImpl .extractTokenFromLocation ("https://master.cluster.local:8443/oauth/token/display#access_token=VO4dAgNGLnX5MGYu_wXau8au2Rw0QAqnwq8AtrLkMfU&expires_in=86400&token_type=bearer" );
101
101
assertEquals ("VO4dAgNGLnX5MGYu_wXau8au2Rw0QAqnwq8AtrLkMfU" , token .value );
102
102
103
103
// We are optimistic here and expect the test to run in less than a second.
104
- // TODO: Improve
105
- assertEquals (86100000 , token .expire - System .currentTimeMillis ());
104
+ assertEquals (86400 - OpenShiftBearerTokenCredentialImpl .EARLY_EXPIRE_DELAY_SEC , (token .expire - System .currentTimeMillis ())/1000 );
106
105
}
107
106
108
107
@ Test
You can’t perform that action at this time.
0 commit comments