@Test
public void testPutConnectionBackInPartitionWithResetConnectionOnClose() throws InterruptedException, SQLException {

	expect(mockPartition.getFreeConnections()).andReturn(mockConnectionHandles).anyTimes();
	expect(mockPartition.getAvailableConnections()).andReturn(1).anyTimes();
	expect(mockConnection.getOriginatingPartition()).andReturn(mockPartition).anyTimes();
	expect(mockConnectionHandles.offer(mockConnection)).andReturn(true).once();
	expect(mockConnection.isTxResolved()).andReturn(false).once();
	Connection mockInternalConnection = EasyMock.createNiceMock(Connection.class);
	expect(mockInternalConnection.getAutoCommit()).andReturn(false).once();
	expect(mockConnection.getInternalConnection()).andReturn(mockInternalConnection).anyTimes();
	mockInternalConnection.rollback();
	mockInternalConnection.setAutoCommit(true);
	replay(mockInternalConnection, mockPartition, mockConnectionHandles, mockConnection);
	testClass.resetConnectionOnClose = true;
	testClass.putConnectionBackInPartition(mockConnection);
	verify(mockPartition, mockConnectionHandles);
}