Package io.dropwizard.testing.common
Class DAOTest
- java.lang.Object
-
- io.dropwizard.testing.common.DAOTest
-
public class DAOTest extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DAOTest.Builder<B extends DAOTest.Builder<B>>
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
after()
void
before()
org.hibernate.SessionFactory
getSessionFactory()
Returns the current active session factory for injecting to DAOs.void
inTransaction(Runnable action)
Performs an action in a transaction<T> T
inTransaction(Callable<T> call)
Performs a call in a transaction
-
-
-
Method Detail
-
after
public void after()
-
getSessionFactory
public org.hibernate.SessionFactory getSessionFactory()
Returns the current active session factory for injecting to DAOs. `- Returns:
SessionFactory
with an open session.
-
inTransaction
public <T> T inTransaction(Callable<T> call)
Performs a call in a transaction- Type Parameters:
T
- the type of the returned result- Parameters:
call
- the call- Returns:
- the result of the call
-
inTransaction
public void inTransaction(Runnable action)
Performs an action in a transaction- Parameters:
action
- the action
-
-