diff --git a/pom.xml b/pom.xml index 28f1e5b..ebb9ac2 100644 --- a/pom.xml +++ b/pom.xml @@ -110,11 +110,20 @@ springfox-swagger2 2.8.0 + io.springfox springfox-swagger-ui 2.8.0 + + + + org.mockito + mockito-all + 1.9.5 + test + diff --git a/src/test/java/com/revature/screenforce/service/ReportsServiceImpTest.java b/src/test/java/com/revature/screenforce/service/ReportsServiceImpTest.java new file mode 100644 index 0000000..ca4762c --- /dev/null +++ b/src/test/java/com/revature/screenforce/service/ReportsServiceImpTest.java @@ -0,0 +1,51 @@ +package com.revature.screenforce.service; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +import java.util.Collections; +import java.util.List; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.junit4.SpringRunner; + +import com.revature.screenforce.ScreeningReportServiceApplication; +import com.revature.screenforce.beans.Screener; +import com.revature.screenforce.services.ReportsServiceImp; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = ScreeningReportServiceApplication.class) +@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) +@AutoConfigureTestDatabase +public class ReportsServiceImpTest { + + @Mock + Screener screenerTest; + + @Rule public MockitoRule mockitoRule = MockitoJUnit.rule(); + + @Autowired + ReportsServiceImp repostsServiceImp; + + @Test + public void testGetAllEmails() { + List test = repostsServiceImp.getAllEmails("smith"); + assertNotNull(test); + } + + @Test + public void testGetNoEmails() { + List test = repostsServiceImp.getAllEmails("asdf"); + assertEquals(test, Collections.emptyList()); + } +}