public void testDeleteMessageToAnotherUser() throws Exception {
JSONObject json = new JSONObject();
json.put("message", "This is a message to @" + localUser1.getAlias());
SobaMessageResponseDTO message = jsonToObject(makeRequest(getUrl(), "POST", json, authToken),
TypeFactory.defaultInstance().constructType(SobaMessageResponseDTO.class));
assertNotNull(message);
assertEquals(getTestUser().getId(), message.getSenderId());
//
// mock remove it
makeRequest(getUrl() + "/" + message.getId(), "DELETE", json, authToken);
SobaMessageResponseDTO responseDTO = jsonToObject(makeRequest(getUrl() + "/" + message.getId(), "GET",
null, authToken),
TypeFactory.defaultInstance().constructType(SobaMessageResponseDTO.class));
assertEquals(responseDTO.getPayload(), "message removed by @" + testUser.getAlias());
}