I have the standard Application class which runs a Spring batch ETL:
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
with my Junit test doing something like:
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class MyServiceTest {
@Autowired
MyService myService;
@Test
public void testInsertions() {
//do stuff with assertions
}
}
My problem is that when I execute the junit test, the application also kicks off the ETL then executes the test. How to prevent the application from running?