Junit 5 test, getting java.lang.IllegalStateException: Test classes cannot include @Bean methods

Viewed 6962
@ContextConfiguration(classes = ConfigureCustomConfigurationModelProviderTest.class)
    public class ConfigureCustomConfigurationModelProviderTest extends AbstractContextTest {
        @Bean(name = "smth")
        public static ConfigurationModelProvider get() {
            return AnnotationConfigurationModelProvider.getInstance();
        }
        /*...*/
    }

I'm getting this error since migrating from junit4 to junit5. Why?

1 Answers
Related