@Test @Ignore public void testPostMessage() throws Exception { MessageImpl message = new MessageImpl("A message body", "A title", Message.Type.PRIVATE_MESSAGE); message.setRecipients(recipients); EasyMock.expect(converter.convertToObject(null, Message.class)).andReturn(message); EasyMock.expect(messageService.createMessage(sender, "messageHandlerTest", "@outbox", message, token)).andReturn(Futures.immediateFuture((Void) null)); EasyMock.replay(messageService, converter); RestHandler operation = registry.getRestHandler("/messages/" + sender.getUserId() + "/@outbox", "POST"); Map<String,String[]> params = ImmutableMap.of(RequestItem.APP_ID, new String[]{"messageHandlerTest"}); operation.execute(params,null, token, converter).get(); EasyMock.verify(converter, messageService); } }
@Test @Ignore public void testPostMessage() throws Exception { MessageImpl message = new MessageImpl("A message body", "A title", Message.Type.PRIVATE_MESSAGE); message.setRecipients(recipients); EasyMock.expect(converter.convertToObject(null, Message.class)).andReturn(message); EasyMock.expect(messageService.createMessage(sender, "messageHandlerTest", "@outbox", message, token)).andReturn(Futures.immediateFuture((Void) null)); EasyMock.replay(messageService, converter); RestHandler operation = registry.getRestHandler("/messages/" + sender.getUserId() + "/@outbox", "POST"); Map<String,String[]> params = ImmutableMap.of(RequestItem.APP_ID, new String[]{"messageHandlerTest"}); operation.execute(params,null, token, converter).get(); EasyMock.verify(converter, messageService); } }
@Test public void testPostMessage() throws Exception { MessageImpl message = new MessageImpl("A message body", "A title", Message.Type.PRIVATE_MESSAGE); message.setRecipients(recipients); EasyMock.expect(converter.convertToObject(null, Message.class)).andReturn(message); EasyMock.expect(messageService.createMessage(sender, "messageHandlerTest", "@outbox", message, token)).andReturn(ImmediateFuture.newInstance((Void) null)); EasyMock.replay(messageService, converter); RestHandler operation = registry.getRestHandler("/messages/" + sender.getUserId() + "/@outbox", "POST"); Map<String,String[]> params = ImmutableMap.of(RequestItem.APP_ID, new String[]{"messageHandlerTest"}); operation.execute(params,null, token, converter).get(); EasyMock.verify(converter, messageService); } }