I am using AbstractTransactionalDataSourceSpringContextTests (or a subclass) for most integration tests. However, some test methods need to use @NoTransaction. When this is the case, onSetUpBeforeTransaction() which is where we pull beans which cannot be injected by type from the context, resulting NPEs.
Since onSetup is made final by AbstractTransactionalDataSourceSpringContextTests there seems to be no pre-test hook to use. This seems like an oversight in the test classes. I would think at least there should be an onSetup* that /always/ gets invoked -- transaction or not.


Reply With Quote