SobaMessageDAO sobaMessageDAO = mock(SobaMessageDAO.class);
when(sobaMessageDAO.getMessagesFromInbox(any(User.class),anyLong(),anyLong(),anyInt(),
anyBoolean(), anyString(), anyListOf(String.class),anyString(),anyBoolean()))
.thenReturn(null);
MessageServiceImpl messageService = new MessageServiceImpl();
ReflectionTestUtils.setField(messageService,"sobaMessageDAO",sobaMessageDAO);
//Now verify that MessageServiceImpl normalizes the hashtags passing them into the DAO.
List<String> passedInHashtags = ImmutableList.of("foo","#bar","baz");
List<String> expectedHashTags = ImmutableList.of("#foo","#bar","#baz");
messageService.getAllMessages(null,null,null,5,true,null, passedInHashtags,null,false);
verify(sobaMessageDAO).getMessagesFromInbox(null, null, null, 5, true, null, expectedHashTags, null,false);
}