Search in sources :

Example 6 with Session

use of org.hibernate.classic.Session in project gocd by gocd.

the class PipelineStateDaoTest method setup.

@Before
public void setup() throws Exception {
    goCache = new StubGoCache(new TestTransactionSynchronizationManager());
    goCache.clear();
    mockSessionFactory = mock(SessionFactory.class);
    transactionTemplate = mock(TransactionTemplate.class);
    pipelineStateDao = new PipelineStateDao(null, null, goCache, null, transactionTemplate, null, null, null, null, mock(Database.class), mockSessionFactory);
    session = mock(Session.class);
    when(mockSessionFactory.getCurrentSession()).thenReturn(session);
}
Also used : SessionFactory(org.hibernate.SessionFactory) StubGoCache(com.thoughtworks.go.server.service.StubGoCache) TransactionTemplate(com.thoughtworks.go.server.transaction.TransactionTemplate) TestTransactionSynchronizationManager(com.thoughtworks.go.server.transaction.TestTransactionSynchronizationManager) Session(org.hibernate.classic.Session) Before(org.junit.Before)

Aggregations

SessionFactory (org.hibernate.SessionFactory)6 Session (org.hibernate.classic.Session)6 StubGoCache (com.thoughtworks.go.server.service.StubGoCache)3 TestTransactionSynchronizationManager (com.thoughtworks.go.server.transaction.TestTransactionSynchronizationManager)3 TransactionTemplate (com.thoughtworks.go.server.transaction.TransactionTemplate)3 Before (org.junit.Before)3 GoConfigDao (com.thoughtworks.go.config.GoConfigDao)2 MaterialRepository (com.thoughtworks.go.server.persistence.MaterialRepository)2 TransactionSynchronizationManager (com.thoughtworks.go.server.transaction.TransactionSynchronizationManager)2 SqlMapClientTemplate (org.springframework.orm.ibatis.SqlMapClientTemplate)2