@@ -0,0 +1,2351 @@
+package at.fhj.swd14.pse.comment;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport at.fhj.swd14.pse.message.Message;%0Aimport at.fhj.swd14.pse.message.MessageDto;%0Aimport at.fhj.swd14.pse.user.User;%0Aimport at.fhj.swd14.pse.user.UserDto;%0A%0Apublic class CommentConverterTest%0A%7B%0A%09private Comment comment;%0A%09private CommentDto commentDto;%0A%09%0A%09@Before%0A%09public void setup()%0A%09%7B%0A%09%09comment = new Comment(1L);%0A%09%09comment.setText(%22blabla%22);%0A%09%09comment.setParentMessage(new Message(1L));%0A%09%09comment.setAuthor(new User(1L));%0A%09%09%0A%09%09commentDto = new CommentDto(1L);%0A%09%09commentDto.setText(%22blabla%22);%0A%09%09commentDto.setParentMessage(new MessageDto(1L));%0A%09%09commentDto.setAuthor(new UserDto(1L));%09%09%0A%09%7D%0A%09%0A%09@Test%0A%09public void testConvertToComment()%0A%09%7B%09%0A%09%09Comment commentConverter = CommentConverter.convert(commentDto);%0A%09%09%0A%09%09Assert.assertEquals(comment.getId(), commentConverter.getId());%0A%09%09Assert.assertEquals(comment.getText(), commentConverter.getText());%0A%09%7D%0A%0A%09@Test%0A%09public void testConvertToCommentNull()%0A%09%7B%09%09%0A%09%09CommentDto commentDtoNull = null;%0A%09%09%0A%09%09Comment commentConverter = CommentConverter.convert(commentDtoNull , null);%0A%09%09%0A%09%09Assert.assertNull(commentConverter);%0A%09%7D%09%0A%0A%09@Test%0A%09public void testConvertToCommentMessageNull()%0A%09%7B%09%09%0A%09%09commentDto.setParentMessage(null);%0A%09%09%0A%09%09Comment commentConverter = CommentConverter.convert(commentDto);%0A%09%09%0A%09%09Assert.assertNull(commentConverter.getParentMessage());%0A%09%7D%09%09%0A%09%0A%09@Test%0A%09public void testConvertToDto()%0A%09%7B%0A%09%09CommentDto commentConverter = CommentConverter.convert(comment);%0A%09%09%0A%09%09Assert.assertEquals(commentDto.getId(), commentConverter.getId());%0A%09%09Assert.assertEquals(commentDto.getText(), commentConverter.getText());%0A%09%09Assert.assertEquals(commentDto.getAuthor().getId(), commentConverter.getAuthor().getId());%0A%09%7D%0A%0A%09@Test%0A%09public void testConvertToDtoMessage()%0A%09%7B%0A%09%09commentDto.setParentMessage(new MessageDto(1L));%0A%0A%09%09MessageDto parentMessage = new MessageDto(1L); %0A%09%09%0A%09%09CommentDto commentConverter = CommentConverter.convert(comment, parentMessage);%0A%09%09%0A%09%09Assert.assertEquals(commentDto.getParentMessage(), commentConverter.getParentMessage());%0A%09%7D%0A%0A%09@Test%0A%09public void testConvertToDtoMessageNull()%0A%09%7B%0A%09%09comment = null;%0A%0A%09%09MessageDto parentMessage = new MessageDto(1L); %0A%09%09%0A%09%09CommentDto commentConverter = CommentConverter.convert(comment, parentMessage);%0A%09%09%0A%09%09Assert.assertNull(commentConverter);%0A%09%7D%0A%0A%7D%0A

add commentConverter test