I have two test classes
public class Test_1 {
@Autowired
private Gson gson;
@Test
public void test_1_1 () {
assertNotNull(gson);
}
}
public class Test_2 {
@Autowired
private Gson gson;
@Test
public void test_2_1 () {
assertNotNull(gson);
}
}
Both require spring application Context. But instead of giving @RnWith(SpringRunner.class) & @ContextConfiguration(classes = {Config.class)}) on both the classes I want to initialise Application Context once. And at the same time I should be able to run single(any test through eclipse) test. Is this possible.
Gone through this : test suite inside spring context. but its loading the application context but not available in Test_1 or Test_2 (gson is null).