From dfe5f660f1e86ce91a1601a96818bed468aa8987 Mon Sep 17 00:00:00 2001 From: rvsathe <38076470+rvsathe@users.noreply.github.com> Date: Tue, 11 May 2021 07:44:05 +0530 Subject: [PATCH] do not need --- .../HexagonalLibraryApplicationTest.java | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 hexagonal-example/src/test/java/com/baeldung/hexagonalPattern/HexagonalLibraryApplicationTest.java diff --git a/hexagonal-example/src/test/java/com/baeldung/hexagonalPattern/HexagonalLibraryApplicationTest.java b/hexagonal-example/src/test/java/com/baeldung/hexagonalPattern/HexagonalLibraryApplicationTest.java deleted file mode 100644 index c73ae11d1d..0000000000 --- a/hexagonal-example/src/test/java/com/baeldung/hexagonalPattern/HexagonalLibraryApplicationTest.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.baeldung.hexagonalPattern; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.util.ArrayList; -import java.util.List; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnitRunner; - -import com.baeldung.hexagonalPattern.core.domain.Book; -import com.baeldung.hexagonalPattern.core.impl.LibraryServiceImpl; - -@RunWith(MockitoJUnitRunner.class) -public class HexagonalLibraryApplicationTest { - - @Mock - private LibraryServiceImpl libService = org.mockito.Mockito.mock(LibraryServiceImpl.class);; - Book bk = new Book(); - Book book; - - @Test - public void when_InsertBook_then_returnInteger() { - Mockito.when(libService.insertBook(bk)).thenReturn(1); - int returnVal = libService.insertBook(bk); - assertEquals(1, returnVal); - } - - @Test - public void when_SearchBook_then_returnBookObject() { - Book returnBook = new Book(); - Mockito.lenient().when(libService.searchBook("Pride and Prejudice")).thenReturn(returnBook); - assertNotNull(returnBook); - } - - @Test - public void when_getAllBooks_then_returnListofBookObjects() { - List returnBookList = new ArrayList(); - returnBookList = libService.getAllBooks(); - assertNotNull(returnBookList); - } -}