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 classDAOTest.Builder<B extends DAOTest.Builder<B>>
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafter()voidbefore()org.hibernate.SessionFactorygetSessionFactory()Returns the current active session factory for injecting to DAOs.voidinTransaction(Runnable action)Performs an action in a transaction<T> TinTransaction(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:
SessionFactorywith 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
-
-