@Test
public final void testRunShouldRestartAmqWhenAmqMemoryIsFull() throws Exception {

    // GIVEN
    Whitebox.setInternalState(underTest, "fIDecompressionEnabled", true);
    Whitebox.setInternalState(underTest, "messageWritingEnabled", true);
    QueueSizeProvider queueSizeProvider = new QueueSizeProvider();
    Whitebox.setInternalState(underTest, "queueSizeProvider", queueSizeProvider);
    given(mBeanServerConnection.getAttribute(responseQueue, "QueueSize")).willReturn(new Long(0));
    given(mBeanServerConnection.getAttribute(loggerQueue, "QueueSize")).willReturn(new Long(0));
    given(mBeanServerConnection.getAttribute(dlqQueue, "QueueSize")).willReturn(new Long(1));
    given(mBeanServerConnection.getAttribute(amqObject, "MemoryPercentUsage")).willReturn(new Integer(JmsQueueMonitorTask.MAX_AMQ_MEMORY_USAGE + 1));
    // WHEN
    underTest.run();
    // THEN
    verify(mBeanServerConnection).invoke(amqObject, "restart", null, null);
}