mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-29 07:12:32 +00:00
PathMatchResult->PathMatchInfo
More fixes for Spring Framework refactoring
This commit is contained in:
parent
bfaead6f68
commit
01579be7d4
@ -45,7 +45,7 @@ public class PathMatcherServerWebExchangeMatcherTests {
|
|||||||
@Mock
|
@Mock
|
||||||
PathPattern pattern;
|
PathPattern pattern;
|
||||||
@Mock
|
@Mock
|
||||||
PathPattern.PathMatchResult pathMatchResult;
|
PathPattern.PathMatchInfo pathMatchInfo;
|
||||||
MockServerWebExchange exchange;
|
MockServerWebExchange exchange;
|
||||||
PathPatternParserServerWebExchangeMatcher matcher;
|
PathPatternParserServerWebExchangeMatcher matcher;
|
||||||
String path;
|
String path;
|
||||||
@ -74,8 +74,8 @@ public class PathMatcherServerWebExchangeMatcherTests {
|
|||||||
@Test
|
@Test
|
||||||
public void matchesWhenPathMatcherTrueThenReturnTrue() {
|
public void matchesWhenPathMatcherTrueThenReturnTrue() {
|
||||||
when(pattern.matches(any())).thenReturn(true);
|
when(pattern.matches(any())).thenReturn(true);
|
||||||
when(pattern.matchAndExtract(any())).thenReturn(pathMatchResult);
|
when(pattern.matchAndExtract(any())).thenReturn(pathMatchInfo);
|
||||||
when(pathMatchResult.getUriVariables()).thenReturn(new HashMap<>());
|
when(pathMatchInfo.getUriVariables()).thenReturn(new HashMap<>());
|
||||||
|
|
||||||
assertThat(matcher.matches(exchange).block().isMatch()).isTrue();
|
assertThat(matcher.matches(exchange).block().isMatch()).isTrue();
|
||||||
}
|
}
|
||||||
@ -91,8 +91,8 @@ public class PathMatcherServerWebExchangeMatcherTests {
|
|||||||
public void matchesWhenPathMatcherTrueAndMethodTrueThenReturnTrue() {
|
public void matchesWhenPathMatcherTrueAndMethodTrueThenReturnTrue() {
|
||||||
matcher = new PathPatternParserServerWebExchangeMatcher(pattern, exchange.getRequest().getMethod());
|
matcher = new PathPatternParserServerWebExchangeMatcher(pattern, exchange.getRequest().getMethod());
|
||||||
when(pattern.matches(any())).thenReturn(true);
|
when(pattern.matches(any())).thenReturn(true);
|
||||||
when(pattern.matchAndExtract(any())).thenReturn(pathMatchResult);
|
when(pattern.matchAndExtract(any())).thenReturn(pathMatchInfo);
|
||||||
when(pathMatchResult.getUriVariables()).thenReturn(new HashMap<>());
|
when(pathMatchInfo.getUriVariables()).thenReturn(new HashMap<>());
|
||||||
|
|
||||||
assertThat(matcher.matches(exchange).block().isMatch()).isTrue();
|
assertThat(matcher.matches(exchange).block().isMatch()).isTrue();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user