@@ -0,0 +1,1257 @@
+package at.fhj.swd14.pse.comment;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.Mockito;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0Aimport at.fhj.swd14.pse.converter.CommentConverter;%0Aimport at.fhj.swd14.pse.repository.CommentRepository;%0Aimport at.fhj.swd14.pse.user.User;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class CommentServiceImplTest%0A%7B%0A%09@InjectMocks%0A%09private CommentServiceImpl commentServiceImpl;%0A%0A%09@Mock%0A%09private CommentRepository commentRepository;%0A%0A%09private List%3CComment%3E comments;%0A%0A%09@Before%0A%09public void setup()%0A%09%7B%0A%09%09User user = new User();%0A%09%09user.setId(1L);%0A%09%09user.setMail(%22mail%22);%0A%09%09%0A%09%09comments = new ArrayList%3CComment%3E();%0A%09%09Comment comment = new Comment(1L);%0A%09%09comment.setText(%22test-comment%22);%0A%09%09// TODO: check equals errors%0A%09%09// comment.setAuthor(user);%0A%09%09// comment.setParentMessage(new Message(1L));%0A%09%09comments.add(comment);%0A%09%7D%0A%0A%09@Test%0A%09public void testFind()%0A%09%7B%0A%09%09Mockito.when(commentRepository.find(1L)).thenReturn(comments.get(0));%0A%09%09CommentDto c = commentServiceImpl.find(1);%0A%0A%09%09CommentDtoTester.assertEquals(CommentConverter.convert(comments.get(0)), c);%0A%09%7D%0A%0A%7D%0A

add comment test