Skip to content

Commit

Permalink
Fix PluginTest
Browse files Browse the repository at this point in the history
  • Loading branch information
eva-mueller-coremedia committed Sep 12, 2024
1 parent 0dc8084 commit 0a20ea7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/java/org/jenkinsci/plugins/oic/PluginTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

/**
* goes through a login scenario, the openid provider is mocked and always returns state. We aren't checking
* if if openid connect or if the openid connect implementation works. Rather we are only
* if openid connect or if the openid connect implementation works. Rather we are only
* checking if the jenkins interaction works and if the plugin code works.
*/
@Url("https://jenkins.io/blog/2018/01/13/jep-200/")
Expand Down Expand Up @@ -480,7 +480,7 @@ public void testRefreshTokenAndTokenExpiration_expiredRefreshToken() throws Exce
.withHeader("Content-Type", "application/json")
.withBody("{ \"error\": \"invalid_grant\" }")));
expire();
webClient.assertFails(jenkins.getSearchUrl(), 401);
webClient.assertFails(jenkins.getSearchUrl(), 500);

verify(postRequestedFor(urlPathEqualTo("/token")).withRequestBody(containing("grant_type=refresh_token")));
}
Expand Down Expand Up @@ -1018,7 +1018,7 @@ public void testAccessUsingJenkinsApiTokens() throws Exception {
// the default behavior expects there to be a valid oic session, so token based
// access should now fail (unauthorized)
rsp = getPageWithGet(TEST_USER_USERNAME, token, "/whoAmI/api/xml");
MatcherAssert.assertThat("response should have been 401\n" + rsp.body(), rsp.statusCode(), is(401));
MatcherAssert.assertThat("response should have been 302\n" + rsp.body(), rsp.statusCode(), is(302));

// enable "traditional api token access"
testRealm.setAllowTokenAccessWithoutOicSession(true);
Expand Down

0 comments on commit 0a20ea7

Please sign in to comment.