Given the following members of my test class
@Mock
private Gateway gateway;
@Autowired
@InjectMocks
private TransactionManager transactionManager;
@BeforeClass
public void before() {
MockitoAnnotations.initMocks(this);
}
The TransactionManager
uses the gateway internally and it is wired up with @Autowired
. When I run the tests in this class, they pass. However when I run tests in a separate class that I am expecting to use the concrete implementation of Gateway
, they are using the mocked Gateway
.