Package com.atlassian.jira.junit.rules
Class AttachToDatabase
java.lang.Object
org.junit.rules.TestWatcher
com.atlassian.jira.junit.rules.AttachToDatabase
- All Implemented Interfaces:
org.junit.rules.TestRule
public class AttachToDatabase
extends org.junit.rules.TestWatcher
Initialises the container pieces you need to attach to a real database when running unit tests.
This rule has the side effect of clearing all tables in the database schema after each test is run. Use
DatabaseContainer
to activate this rule in your tests.
Note that our current intention is to only run these tests against PostgreSQL. As such these tests will not work with
other databases out of the box. Further changes may be required.- Since:
- v7.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAttachToDatabase
(MockitoContainer mockitoContainer) Instead of instantiating this directly, you probably want to useDatabaseContainer.rule(Object)
-
Method Summary
Methods inherited from class org.junit.rules.TestWatcher
apply, failed, skipped, skipped
-
Constructor Details
-
AttachToDatabase
Instead of instantiating this directly, you probably want to useDatabaseContainer.rule(Object)
- Parameters:
mockitoContainer
- the container to load components into
-
-
Method Details
-
starting
protected void starting(org.junit.runner.Description description) - Overrides:
starting
in classorg.junit.rules.TestWatcher
-
succeeded
protected void succeeded(org.junit.runner.Description description) - Overrides:
succeeded
in classorg.junit.rules.TestWatcher
-
finished
protected void finished(org.junit.runner.Description description) - Overrides:
finished
in classorg.junit.rules.TestWatcher
-
getQueryDslAccessor
-
getOfBizDelegator
-