@Test(expected = MessageReadException.class) public void shouldFailWhenReadingAnUnknownMessageNumber() throws CommunicationException { when(client.tryReceiveByte()).thenReturn(UNKNOWN_MESSAGE_NUMBER); cut.readMessage(); }
public Message readMessage() throws CommunicationException { return readMessage(readMessageTypeOrFail()); }
MessageBasedClientConnection { public Message readMessage() throws CommunicationException { return readMessage(readMessageTypeOrFail()); } }
MessageBasedClientConnection { public Message readMessage() throws CommunicationException { return readMessage(readMessageTypeOrFail()); } MessageBasedClientConnection(final ClientConnection connection); }
MessageBasedClientConnection { public Message readMessage() throws CommunicationException { return readMessage(readMessageTypeOrFail()); } MessageBasedClientConnection(final ClientConnection connection); Message readMessage(); @SuppressWarnings("unchecked") M readMessage(final Class<M> messageClass); void sendMessage(final Message message); @Override String toString(); }
MessageBasedClientConnection { public Message readMessage() throws CommunicationException { return readMessage(readMessageTypeOrFail()); } MessageBasedClientConnection(final ClientConnection connection); Message readMessage(); @SuppressWarnings("unchecked") M readMessage(final Class<M> messageClass); void sendMessage(final Message message); @Override String toString();  }