public void testSameSession() {
MockRequestContext context = new MockRequestContext();
MockFlowSession flowSession = new MockFlowSession();
flowSession.getDefinition().getAttributes().put("persistenceContext", "true");
hibernateListener.sessionStarting(context, flowSession, null);
context.setActiveSession(flowSession);
assertSessionBound();
final Session hibSession = (Session) flowSession.getScope().get("persistenceContext");
assertNotNull("Should have been populated", hibSession);
hibernateListener.paused(context);
assertSessionNotBound();
hibernateListener.resuming(context);
assertSessionBound();
hibernate.templateExecuteWithNativeSession(session -> assertSame("Should have been original instance", hibSession, session));
hibernateListener.paused(context);
assertSessionNotBound();
}