@@ -82,11 +82,15 @@ public void setUp() throws Exception {
82
82
@ Test
83
83
public void testResolveRedirect_safe () {
84
84
85
- // default uses prefix matching, both of these should work
85
+ // default uses prefix matching, the first one should work fine
86
86
87
87
String res1 = resolver .resolveRedirect (goodUri , client );
88
88
89
89
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 );
90
94
91
95
String res2 = resolver .resolveRedirect (pathUri , client );
92
96
@@ -104,8 +108,7 @@ public void testResolveRedirect_blacklisted() {
104
108
}
105
109
106
110
@ Test
107
- public void testRedirectMatches_strict () {
108
- resolver .setStrictMatch (true );
111
+ public void testRedirectMatches_default () {
109
112
110
113
// this is not an exact match
111
114
boolean res1 = resolver .redirectMatches (pathUri , goodUri );
@@ -120,8 +123,11 @@ public void testRedirectMatches_strict() {
120
123
}
121
124
122
125
@ Test
123
- public void testRedirectMatches_default () {
126
+ public void testRedirectMatches_nonstrict () {
124
127
128
+ // set the resolver to non-strict match mode
129
+ resolver .setStrictMatch (false );
130
+
125
131
// this is not an exact match (but that's OK)
126
132
boolean res1 = resolver .redirectMatches (pathUri , goodUri );
127
133
0 commit comments