assertEquals("Unexpected flow blocked", flowBlocked, row.get(ManagedConnection.FLOW_BLOCKED));
}
private Session createMockedSession(int channelId, int unacknowledgedMessages, long localTransactionBegins, boolean blocked)
{
Session mockSession = mock(Session.class);
Statistics mockSessionStatistics = mock(Statistics.class);
when(mockSessionStatistics.getStatistic(Session.LOCAL_TRANSACTION_BEGINS)).thenReturn(localTransactionBegins);
when(mockSessionStatistics.getStatistic(Session.UNACKNOWLEDGED_MESSAGES)).thenReturn(unacknowledgedMessages);
when(mockSession.getStatistics()).thenReturn(mockSessionStatistics);
when(mockSession.getAttribute(Session.CHANNEL_ID)).thenReturn(channelId);
when(mockSession.getAttribute(Session.PRODUCER_FLOW_BLOCKED)).thenReturn(blocked);
return mockSession;
}