Reputation: 155
When I try to run this code, spring boot app runs but the junit test case never runs. But if I remove "@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)", then Junit tests runs but my spring boot app does not run. In my earlier projects this was never a problem.
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class DataloaderSafetyRankingsTests {
@Test
public void testRandom() {
assertEquals(5, 2);
}
}
Upvotes: 0
Views: 2482
Reputation: 121
Most likely @Test annotation
is not from Junit
. This usually results in test case getting omitted.
Upvotes: 1