@@ -39,12 +39,33 @@ public class CachedTokenSourceTest {
3939 private static Stream <Arguments > provideAsyncRefreshScenarios () {
4040 return Stream .of (
4141 Arguments .of ("Fresh token, async enabled" , FRESH_MINUTES , 0L , false , false , INITIAL_TOKEN ),
42- Arguments .of ("Stale token, async enabled" , STALE_MINUTES , STALE_ADVANCE_MINUTES , false , true , INITIAL_TOKEN ),
43- Arguments .of ("Expired token, async enabled" , EXPIRED_MINUTES , 0L , false , true , REFRESH_TOKEN ),
42+ Arguments .of (
43+ "Stale token, async enabled" ,
44+ STALE_MINUTES ,
45+ STALE_ADVANCE_MINUTES ,
46+ false ,
47+ true ,
48+ INITIAL_TOKEN ),
49+ Arguments .of (
50+ "Expired token, async enabled" , EXPIRED_MINUTES , 0L , false , true , REFRESH_TOKEN ),
4451 Arguments .of ("Fresh token, async disabled" , FRESH_MINUTES , 0L , true , false , INITIAL_TOKEN ),
45- Arguments .of ("Stale token, async disabled" , STALE_MINUTES , STALE_ADVANCE_MINUTES , true , false , INITIAL_TOKEN ),
46- Arguments .of ("Stale token, capped stale duration, async enabled" , CAPPED_STALE_MINUTES , CAPPED_STALE_ADVANCE_MINUTES , false , true , INITIAL_TOKEN ),
47- Arguments .of ("Expired token, async disabled" , EXPIRED_MINUTES , 0L , true , true , REFRESH_TOKEN ));
52+ Arguments .of (
53+ "Stale token, async disabled" ,
54+ STALE_MINUTES ,
55+ STALE_ADVANCE_MINUTES ,
56+ true ,
57+ false ,
58+ INITIAL_TOKEN ),
59+ Arguments .of (
60+ "Stale token, capped stale duration, async enabled" ,
61+ CAPPED_STALE_MINUTES ,
62+ CAPPED_STALE_ADVANCE_MINUTES ,
63+ false ,
64+ true ,
65+ INITIAL_TOKEN ),
66+ Arguments .of (
67+ "Expired token, async disabled" , EXPIRED_MINUTES , 0L , true , true , REFRESH_TOKEN )
68+ );
4869 }
4970
5071 @ ParameterizedTest (name = "{0}" )
@@ -67,7 +88,11 @@ void testAsyncRefreshParametrized(
6788 null ,
6889 Instant .now (clockSupplier .getClock ()).plus (Duration .ofMinutes (minutesUntilExpiry )));
6990 Token refreshedToken =
70- new Token (REFRESH_TOKEN , TOKEN_TYPE , null , Instant .now (clockSupplier .getClock ()).plus (Duration .ofMinutes (10 )));
91+ new Token (
92+ REFRESH_TOKEN ,
93+ TOKEN_TYPE ,
94+ null ,
95+ Instant .now (clockSupplier .getClock ()).plus (Duration .ofMinutes (10 )));
7196 CountDownLatch refreshCalled = new CountDownLatch (1 );
7297
7398 TokenSource tokenSource =
0 commit comments