Code example for SessionFactory

Methods: openStatelessSession

0
	 
	@Test
	public void testOneSessionForAllPages() throws Exception {
 
		StatelessSession session = mock(StatelessSession.class);
		when(sessionFactory.openStatelessSession()).thenReturn(session);
		 
		helper.setSessionFactory(sessionFactory);
 
		helper.createQuery();
		// Multiple calls to createQuery only creates one session 
		helper.createQuery();
 
	} 
 
	@Test
	public void testSessionReset() throws Exception {
 
		StatelessSession session = mock(StatelessSession.class);
		when(sessionFactory.openStatelessSession()).thenReturn(session);
Connect your IDE to all the code out there  Get Codota for Java