ProjectBlogEntryDTOMapper extends BaseMapper { public IProjectBlogEntry getProjectBlogEntry(ProjectBlogEntryDTO projectBlogEntryDTO) throws QuadrigaStorageException { IProjectBlogEntry projectBlogEntry = new ProjectBlogEntry(); projectBlogEntry.setProjectBlogEntryId(projectBlogEntryDTO.getProjectBlogEntryId()); projectBlogEntry.setTitle(projectBlogEntryDTO.getTitle()); projectBlogEntry.setDescription(projectBlogEntryDTO.getDescription()); projectBlogEntry.setCreatedDate(projectBlogEntryDTO.getCreatedDate()); projectBlogEntry.setProjectId(projectBlogEntryDTO.getProjectid()); String author = projectBlogEntryDTO.getAuthor(); projectBlogEntry.setAuthor(userManager.getUser(author)); return projectBlogEntry; }  ProjectBlogEntryDTO getProjectBlogEntryDTO(IProjectBlogEntry projectBlogEntry); IProjectBlogEntry getProjectBlogEntry(ProjectBlogEntryDTO projectBlogEntryDTO);  }
@Test public void getProjectBlogEntry() throws QuadrigaStorageException { ProjectBlogEntryDTO projectBlogEntryDTO = new ProjectBlogEntryDTO(); projectBlogEntryDTO.setProjectBlogEntryId(ID); projectBlogEntryDTO.setTitle(TITLE); projectBlogEntryDTO.setDescription(DESCRIPTION); projectBlogEntryDTO.setAuthor(AUTHOR_NAME); projectBlogEntryDTO.setCreatedDate(CREATED_DATE); projectBlogEntryDTO.setProjectid(PROJECT_ID); IUser author = new User(); author.setName(AUTHOR_NAME); Mockito.when(userManager.getUser(AUTHOR_NAME)).thenReturn(author); IProjectBlogEntry projectBlogEntry = projectBlogEntryDTOMapperUnderTest .getProjectBlogEntry(projectBlogEntryDTO); assertProjectBlogEntryMapping(projectBlogEntry); }