This is hopefully a simple question.
I have a Spring Boot Test.
The annotations are:
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Main.class)
@TestPropertySource(locations { "myproperties.properties" })
I've got a test that I'd love to use @RunWith(Theories.class). The test is testing basically the same thing over several different places in my code.
Of course, @RunWith must be singular.
So is there a way to have the theories started up as a rule? Or SpringRunner.class? Or something so that they can co-exist?
There should be two ways to solve that:
SpringClassRule and SpringMethodRule <-- I use this approach
just use
Initializing the TestContextManager Manually according to Baeldung it works for Parameterized, but I wouldn't know why it shouldn't work for Theories also ;) Generally, it is not recommended to initialize the TestContextManager manually. Instead, Spring recommends using SpringClassRule and SpringMethodRule.