public class DBSpec extends DbConfiguration implements JSpecSupport
database.properties
file. Test connection transactions work in the following manner:
false
Constructor and Description |
---|
DBSpec() |
Modifier and Type | Method and Description |
---|---|
void |
closeTestConnections() |
void |
openTestConnections() |
boolean |
rollback()
Current state of 'rollback' flag.
|
void |
setRollback(boolean rollback)
Set to true in order to rollback a transaction at the end of the test.
|
void |
suppressDb(boolean suppressDb)
Call this method from a constructor of your spec in cases you do not need DB connections.
|
boolean |
suppressedDb() |
addConnectionWrapper, clearConnectionWrappers, clearConnectionWrappers, getConnectionSpecWrappers, getConnectionSpecWrappers, getTestConnectionWrappers, loadConfiguration, resetConnectionWrappers
public boolean suppressedDb()
public void suppressDb(boolean suppressDb)
public boolean rollback()
public void setRollback(boolean rollback)
WARNING: if you set this value to false inside your test, the framework will not clean any remaining data you insert into your test database. Basically, this is a "manual mode" where you are responsible for cleaning after yourself.
rollback
- true to rollback transactions at the end of the test, false to not rollback.@BeforeEach public final void openTestConnections()
@AfterEach public final void closeTestConnections()
Copyright © 2019 JavaLite. All rights reserved.