Code example for AbstractTransactionalTestNGSpringContextTests

0
 * @author masyan 
 */ 
@ContextConfiguration(locations = {"classpath:/org/jtalks/jcommune/model/entity/applicationContext-dao.xml"}) 
@TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = true) 
@Transactional 
public class BranchHibernateDaoTest extends AbstractTransactionalTestNGSpringContextTests { 
 
    @Autowired 
    private SessionFactory sessionFactory; 
    @Autowired 
    private BranchDao dao; 
    private Session session; 
    Branch branch; 
 
    @BeforeMethod 
    public void setUp() throws Exception { 
        session = sessionFactory.getCurrentSession(); 
        PersistedObjectsFactory.setSession(session); 
        branch = ObjectsFactory.getDefaultBranch(); 
    } 
Experience pair programming with AI  Get Codota for Java