@Test
public void testSend() throws Exception {

    input.substitute("send 127.0.0.1 8080\ntoWhom\nThis is a message\nEOM\nexit\n");
    //---------------------------------------------------------------------^ For the no-reply prompt
    RequestPacket requestPacket = RequestPacket.newMessage((PrivateKey) randomKey(), ((PrivateKey)randomKey()).toPublicKey(), "toWhom", name);
    requestPacket.setCommunications(communications);
    requestPacket.setMessage("This is the response");
    expect(communications.sendMessage("127.0.0.1", "8080", "This is a message\n", "toWhom")).andReturn(requestPacket);
    replay(communications);
    console.run();
    doMatch(outputStream, "client> Enter the name of the receiver: Enter a message \\(max 4096 bytes\\) followed by EOM on a blank line:\n" +
            "Message From \\[toWhom:([A-F0-9]{2} ?){8}\\]\n" +
            "Message is for \\[[a-z]+:([A-F0-9]{2} ?){8}\\]\n" +
            "===== Begin Message =====\n" +
            "This is the response\n" +
            "=====  End Message  =====\n" +
            "===== Begin Reply Nonce =====\n" +
            "([A-F0-9]{2} ?)+\n" +
            "=====  End Reply Nonce  =====\n" +
            "\n" +
            "client> ");
    verify(communications);
}