Backend Development
@RunWith(SpringJUnit4ClassRunner.class)
In order for the unit test to run a batch job, the framework must load the job’s ApplicationContext. Two annotations are used to trigger this: @RunWith(SpringJUnit4ClassRunner.class): Indicates that the class should use Spring’s JUnit facilities. @ContextConfiguration(locations = {…}): Indicates which XML files contain the ApplicationContext. For example: import org.junit.Test; import Read more…