Closed
Description
Keir Lawson opened SPR-16976 and commented
I attempted to port the Spring web testing example at https://github.com/spring-guides/gs-testing-web to Java 10 and modules, however I find when running my tests via Maven that the @SpringBootTest
annotation is no longer able to locate my application class despite the code working previously before modularisation.I receive the following error when running mvn test
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
Adding the application class explicitly as this message suggests then results in
java.lang.reflect.InaccessibleObjectException: Unable to make field private static java.lang.Object hello.Application$$EnhancerBySpringCGLIB$$d7dfca41.CGLIB$CALLBACK_FILTER accessible: module gs.testing.web does not "opens hello" to unnamed module @2fc6f97f
The changes I made to the initial repo can be viewed here: spring-guides/gs-testing-web@master...keirlawson:j10_modules
No further details from SPR-16976
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
spring-projects-issues commentedon Jun 26, 2018
Juergen Hoeller commented
Please report this to the Spring Boot issue tracker on GitHub first: https://github.com/spring-projects/spring-boot/issues
There might be a core framework issue hiding here (which this JIRA instance is for) in which case I'm happy to reopen this JIRA ticket after the Boot team had a first pass.
spring-projects-issues commentedon Jun 26, 2018
Keir Lawson commented
Have opened spring-projects/spring-boot#13581 as requested.