@@ -0,0 +1,1998 @@
+package Controller;%0A%0Aimport javax.ws.rs.client.Entity;%0Aimport javax.ws.rs.core.Application;%0Aimport javax.ws.rs.core.MediaType;%0Aimport javax.ws.rs.core.Response;%0A%0Aimport org.glassfish.jersey.servlet.ServletContainer;%0Aimport org.glassfish.jersey.test.DeploymentContext;%0Aimport org.glassfish.jersey.test.JerseyTest;%0Aimport org.glassfish.jersey.test.ServletDeploymentContext;%0Aimport org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory;%0Aimport org.glassfish.jersey.test.spi.TestContainerFactory;%0Aimport org.junit.Assert;%0Aimport org.junit.FixMethodOrder;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.MethodSorters;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.MockitoAnnotations;%0Aimport org.springframework.boot.test.context.SpringBootTest;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0A%0Aimport com.demo.app.configuration.JerseyConfig;%0Aimport com.demo.app.controller.PersonRest;%0Aimport com.demo.app.service.PersonService;%0A%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(classes = Application.class)%0A@SpringBootTest%0A@FixMethodOrder(MethodSorters.NAME_ASCENDING)%0Apublic class PersonRestTest extends JerseyTest %7B%0A%0A%09@InjectMocks%0A%09private PersonRest restResource;%0A%09@Mock%0A%09private PersonService personService;%0A%0A%09@Override%0A%09protected TestContainerFactory getTestContainerFactory() %7B%0A%09%09return new GrizzlyWebTestContainerFactory();%0A%09%7D%0A%0A%09@Override%0A%09protected DeploymentContext configureDeployment() %7B%0A%09%09MockitoAnnotations.initMocks(this);%0A%09%09return ServletDeploymentContext.forServlet(new ServletContainer(new JerseyConfig().register(restResource))).build();%0A%09%7D%0A%0A%09@Test%0A%09public void testGenerate2FakePeople() %7B%0A%09%09Response response = target(%22person/generateFake/2%22).request().put(Entity.entity(new Integer(0), MediaType.TEXT_PLAIN));%0A%09%09Assert.assertEquals(response.readEntity(String.class), %222 Items of type Person inserted%22);%0A%09%7D%0A%7D%0A

Person Test