@Test
  public void testIsForMessage() throws Exception {
    DisconnectMessage message = new DisconnectMessage();
    assertFalse(disconnect.isForMessage(message));

    message.getHeader().setReceipt("blah");
    assertTrue(disconnect.isForMessage(message));

    ReceiptMessage receipt = new ReceiptMessage("blah");
    assertFalse(disconnect.isForMessage(receipt));

    disconnect.interceptMessage(message, hostPort);
    assertTrue(disconnect.isForMessage(receipt));
  }
  @Test(expected = MessageListenerHaltException.class)
  public void testMessageReceived() throws Exception {
    disconnect.setGateway(clientGateway);
    disconnect.setReceiptId("test");

    ReceiptMessage message = new ReceiptMessage("blah");

    disconnect.setCloseOnDisconnectMessage(false);
    disconnect.messageReceived(message, hostPort);

    disconnect.setReceiptId("test");
    disconnect.setCloseOnDisconnectMessage(true);

    disconnect.messageReceived(message, hostPort);
  }
 @After
 public void after() throws Exception {
   disconnect.setReceiptId(null);
 }