Manages Spring test contexts via a TestContextManager.
Implemented as a stackable trait that uses beforeAll() and afterAll() hooks to invoke initialization
and destruction logic, respectively.
Test contexts are marked dirty, and hence cleaned up, after all test methods have executed.
There is currently no support for indicating that a test method dirties a context.
Sample usage:
@ContextConfiguration(classes = Array(classOf[SomeConfiguration]))
class SomeTestSpec extends FlatSpec with TestContextManagement with Matchers {
// Use standard Autowired Spring annotation to inject necessary dependencies// Note that Spring will inject val (read-only) fields
@Autowired
val someDependency: SomeClass = null"Some test" should "verify something" in {
// Test implementation that uses injected dependency
someDependency should not be null
}
}
Manages Spring test contexts via a TestContextManager.
Implemented as a stackable trait that uses beforeAll() and afterAll() hooks to invoke initialization and destruction logic, respectively. Test contexts are marked dirty, and hence cleaned up, after all test methods have executed. There is currently no support for indicating that a test method dirties a context.
Sample usage:
org.springframework.test.context.TestContextManager