File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 99
1010import java .io .IOException ;
1111
12+ /**
13+ * Test authorization token refresh.
14+ */
1215public class AuthorizationTokenRefreshTest extends AbstractGitHubWireMockTest {
1316
17+ /**
18+ * Instantiates a new test.
19+ */
1420 public AuthorizationTokenRefreshTest () throws IOException {
1521 useDefaultGitHub = false ;
1622 }
1723
24+ /**
25+ * Gets the wire mock options.
26+ *
27+ * @return the wire mock options
28+ */
1829 @ Override
1930 protected WireMockConfiguration getWireMockOptions () {
2031 return super .getWireMockOptions ().extensions (templating .newResponseTransformer ());
2132 }
2233
34+ /**
35+ * Retried request should get new token when the old one expires.
36+ */
2337 @ Test
2438 public void testRetriedRequestGetsNewAuthorizationTokenWhenOldOneExpires () throws IOException {
2539 snapshotNotAllowed ();
@@ -31,6 +45,9 @@ public void testRetriedRequestGetsNewAuthorizationTokenWhenOldOneExpires() throw
3145 assertThat ("Usernames match" , "kohsuke" .equals (kohsuke .getLogin ()));
3246 }
3347
48+ /**
49+ * Retried request should not get new token when the old one is still valid.
50+ */
3451 @ Test
3552 public void testRetriedRequestDoesNotGetNewAuthorizationTokenWhenOldOneIsStillValid () throws IOException {
3653 gitHub = getGitHubBuilder ().withAuthorizationProvider (() -> "original token" )
You can’t perform that action at this time.
0 commit comments