After adding annotation RunWith, that is, @RunWith(PowerMockRunner.class)Autwire Spring no longer works!
class B {
@Autowire
SessionFactory session;
}
@RunWith(PowerMockRunner.class)
@PrepareForTest{SomeClass.class}
class Testing {
@Test
methodA(){
//mehod
}
@Test
methodD(){
}
}
Now method A calls a call to class B, but due to annotation RunWith(PowerMockRunner), the Autowiring function does not work. Any help would be greatly appreciated!
source
share