From 92f54da6285b1e4f1f5da672e6a860eb3d2601c3 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Fri, 3 May 2024 14:28:21 +0200 Subject: [PATCH] Bug fixes in WebMvc.fn testing support See gh-30477 --- .../test/web/servlet/setup/RouterFunctionMockMvcBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/setup/RouterFunctionMockMvcBuilder.java b/spring-test/src/main/java/org/springframework/test/web/servlet/setup/RouterFunctionMockMvcBuilder.java index bae9a9fb7bb4..079b363a2695 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/setup/RouterFunctionMockMvcBuilder.java +++ b/spring-test/src/main/java/org/springframework/test/web/servlet/setup/RouterFunctionMockMvcBuilder.java @@ -175,7 +175,7 @@ public RouterFunctionMockMvcBuilder setViewResolvers(ViewResolver...resolvers) { * Atom). */ public RouterFunctionMockMvcBuilder setSingleView(View view) { - this.viewResolvers = Collections.singletonList(new StaticViewResolver(view)); + this.viewResolvers = Collections.singletonList(new StaticViewResolver(view)); return this; } @@ -226,7 +226,7 @@ private void registerRouterFunction(StubWebApplicationContext wac) { ContentNegotiationManager mvcContentNegotiationManager = config.mvcContentNegotiationManager(); wac.addBean("mvcContentNegotiationManager", mvcContentNegotiationManager); - RouterFunctionMapping hm = config.routerFunctionMapping(mvcConversionService, resourceUrlProvider); + RouterFunctionMapping hm = config.getHandlerMapping(mvcConversionService, resourceUrlProvider); if (sc != null) { hm.setServletContext(sc); }