Optimize object creation PartialMatchHelper

See gh-29634
This commit is contained in:
koo.taejin
2022-12-04 15:18:22 +09:00
committed by rstoyanchev
parent f457c17c78
commit 5ac97b16a8
4 changed files with 53 additions and 9 deletions

View File

@@ -21,6 +21,7 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -345,6 +346,17 @@ public class RequestMappingInfoHandlerMappingTests {
}
@Test
public void handleNoMatchEmptyRequestMappingInfo() throws Exception {
ServerWebExchange exchange = MockServerWebExchange.from(post("/bar"));
HandlerMethod handlerMethod = this.handlerMapping.handleNoMatch(new HashSet<>(), exchange);
assertThat(handlerMethod).isNull();
handlerMethod = this.handlerMapping.handleNoMatch(null, exchange);
assertThat(handlerMethod).isNull();
}
@SuppressWarnings("unchecked")
private <T> void assertError(Mono<Object> mono, final Class<T> exceptionClass, final Consumer<T> consumer) {