ProjectBlogEntryDTOMapper extends BaseMapper { public ProjectBlogEntryDTO getProjectBlogEntryDTO(IProjectBlogEntry projectBlogEntry) { ProjectBlogEntryDTO projectBlogEntryDTO = new ProjectBlogEntryDTO(); projectBlogEntryDTO.setProjectBlogEntryId(projectBlogEntry.getProjectBlogEntryId()); projectBlogEntryDTO.setTitle(projectBlogEntry.getTitle()); projectBlogEntryDTO.setDescription(projectBlogEntry.getDescription()); projectBlogEntryDTO.setCreatedDate(projectBlogEntry.getCreatedDate()); String username = projectBlogEntry.getAuthor().getUserName(); QuadrigaUserDTO author = getUserDTO(username); projectBlogEntryDTO.setProjectBlogEntryAuthorDTO(author); projectBlogEntryDTO.setAuthor(author.getUsername()); projectBlogEntryDTO.setProjectid(projectBlogEntry.getProjectId()); return projectBlogEntryDTO; }  ProjectBlogEntryDTO getProjectBlogEntryDTO(IProjectBlogEntry projectBlogEntry); IProjectBlogEntry getProjectBlogEntry(ProjectBlogEntryDTO projectBlogEntryDTO);  }
@Test public void getProjectBlogEntryDTOTest() { IProjectBlogEntry projectBlogEntry = new ProjectBlogEntry(); projectBlogEntry.setProjectBlogEntryId(ID); projectBlogEntry.setTitle(TITLE); projectBlogEntry.setDescription(DESCRIPTION); projectBlogEntry.setCreatedDate(CREATED_DATE); projectBlogEntry.setProjectId(PROJECT_ID); IUser author = new User(); author.setUserName(AUTHOR_NAME); projectBlogEntry.setAuthor(author); ProjectBlogEntryDTOMapper projectBlogEntryDTOMapperUnderTest = getProjectBlogEntryDTOMapper(); ProjectBlogEntryDTO projectBlogEntryDTO = projectBlogEntryDTOMapperUnderTest .getProjectBlogEntryDTO(projectBlogEntry); assertProjectBlogEntryDTOMapping(projectBlogEntryDTO); }