### Question:
DirectMessageTemplate extends AbstractTwitterOperations implements DirectMessageOperations { public DirectMessage getDirectMessage(long id) { requireUserAuthorization(); return restTemplate.getForObject(buildUri("direct_messages/show.json", "id", String.valueOf(id)), DirectMessage.class); } DirectMessageTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser, boolean isAuthorizedForApp); List<DirectMessage> getDirectMessagesReceived(); List<DirectMessage> getDirectMessagesReceived(int page, int pageSize); List<DirectMessage> getDirectMessagesReceived(int page, int pageSize, long sinceId, long maxId); List<DirectMessage> getDirectMessagesSent(); List<DirectMessage> getDirectMessagesSent(int page, int pageSize); List<DirectMessage> getDirectMessagesSent(int page, int pageSize, long sinceId, long maxId); DirectMessage getDirectMessage(long id); DirectMessage sendDirectMessage(String toScreenName, String text); DirectMessage sendDirectMessage(long toUserId, String text); void deleteDirectMessage(long messageId);  }### Answer:
@Test public void getDirectMessage() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(jsonResource("directMessage"), APPLICATION_JSON)); DirectMessage message = twitter.directMessageOperations().getDirectMessage(23456); assertSingleDirectMessage(message); }