Skip to content

Commit c11e47a

Browse files
committed
fixed unit test for new default redirect behavior
1 parent 2f31ced commit c11e47a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

openid-connect-server/src/test/java/org/mitre/oauth2/service/impl/TestBlacklistAwareRedirectResolver.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ public void setUp() throws Exception {
8282
@Test
8383
public void testResolveRedirect_safe() {
8484

85-
// default uses prefix matching, both of these should work
85+
// default uses prefix matching, the first one should work fine
8686

8787
String res1 = resolver.resolveRedirect(goodUri, client);
8888

8989
assertThat(res1, is(equalTo(goodUri)));
90+
91+
// set the resolver to non-strict and test the path-based redirect resolution
92+
93+
resolver.setStrictMatch(false);
9094

9195
String res2 = resolver.resolveRedirect(pathUri, client);
9296

@@ -104,8 +108,7 @@ public void testResolveRedirect_blacklisted() {
104108
}
105109

106110
@Test
107-
public void testRedirectMatches_strict() {
108-
resolver.setStrictMatch(true);
111+
public void testRedirectMatches_default() {
109112

110113
// this is not an exact match
111114
boolean res1 = resolver.redirectMatches(pathUri, goodUri);
@@ -120,8 +123,11 @@ public void testRedirectMatches_strict() {
120123
}
121124

122125
@Test
123-
public void testRedirectMatches_default() {
126+
public void testRedirectMatches_nonstrict() {
124127

128+
// set the resolver to non-strict match mode
129+
resolver.setStrictMatch(false);
130+
125131
// this is not an exact match (but that's OK)
126132
boolean res1 = resolver.redirectMatches(pathUri, goodUri);
127133

0 commit comments

Comments
 (0)