CrmWebserviceEndpoint { @WebMethod public ContactDto getContactIncludingHistory(@WebParam(name = "id") long id) { Contact contact = contactDao.find(id, new HashMap<String, Object>()); ContactDto contactDto = new ContactDto(); obtainContactMapper().mapContactInclHistory(contact, contactDto); return contactDto; } CrmWebserviceEndpoint();  CrmWebserviceEndpoint(ContactDao contactDao); @Inject @WebMethod(exclude = true) void setContactDao(ContactDaoEjb contactDao); @WebMethod List<ContactDto> getContracts(@WebParam(name = "from") int from, @WebParam(name = "limit") int limit); @WebMethod ContactDto getContactIncludingHistory(@WebParam(name = "id") long id); @WebMethod ContactDto addContact(@WebParam(name = "contactDto") ContactDto contactDto); @WebMethod ContactDto updateContact(@WebParam(name = "contactDto") ContactDto contactDto); @WebMethod ContactDto addHistoryToContact(@WebParam(name = "contactDto") ContactDto contactDto, @WebParam(name = "historyDto") HistoryDto historyDto,
			@WebParam(name = "returnHistory") boolean returnHistory);  }
@SuppressWarnings("unchecked") @Test public void testGetContactIncludingHistory() { when(contactDao.find(any(), anyMap())).thenReturn(contactRef); ContactDto res = webservice.getContactIncludingHistory(3); verify(contactDao).find(eq(new Long(3)), anyMap()); assertNotNull(res); assertEquals("Hans Hummel", res.getName()); assertEquals(1, res.getHistory().size()); assertEquals("mors, mors", res.getHistory().get(0).getText()); }