Skip to content

Commit 34b3c61

Browse files
Fixed TestGenericEntityViewController: @controller is now required:
Otherwise request mappings (methods) are not picked up: spring-projects/spring-framework#22154
1 parent 4394cb6 commit 34b3c61

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

entity-module/src/main/java/com/foreach/across/modules/entity/controllers/admin/GenericEntityViewController.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import org.springframework.beans.factory.annotation.Qualifier;
4545
import org.springframework.core.convert.ConversionService;
4646
import org.springframework.http.HttpMethod;
47+
import org.springframework.stereotype.Controller;
4748
import org.springframework.ui.ModelMap;
4849
import org.springframework.validation.BindingResult;
4950
import org.springframework.validation.MessageCodesResolver;
@@ -69,6 +70,11 @@
6970
*/
7071
@AdminWebController
7172
@RequestMapping(PATH_ENTITY_TYPE)
73+
// Spring 5 picked up the request handlers if you had only the @RequestMapping annotation.
74+
// Spring 6 requires the @Controller annotation:
75+
// https://github.com/spring-projects/spring-framework/issues/22154
76+
// https://github.com/spring-projects/spring-framework/commit/3600644ed1776dce35c4a42d74799a90b90e359e
77+
@Controller
7278
@SuppressWarnings("unused")
7379
public class GenericEntityViewController
7480
{

entity-module/src/test/java/com/foreach/across/modules/entity/controllers/admin/TestGenericEntityViewController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import com.foreach.across.modules.web.resource.WebResourceRegistry;
3232
import com.foreach.across.modules.web.resource.WebResourceUtils;
3333
import org.junit.jupiter.api.BeforeEach;
34+
import org.junit.jupiter.api.Disabled;
3435
import org.junit.jupiter.api.Test;
3536
import org.junit.jupiter.api.extension.ExtendWith;
3637
import org.mockito.InOrder;

entity-module/src/test/resources/logback-test.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@
1818
<include resource="logback-across-test.xml"/>
1919

2020
<logger name="com.foreach.across.modules.entity" level="TRACE"/>
21+
<!--
22+
<logger name="org.springframework.web" level="DEBUG"/>
23+
-->
2124
</configuration>

0 commit comments

Comments
 (0)