Mark integration tests (#1690)

This commit is contained in:
Grzegorz Piwowarek 2017-04-19 19:27:30 +02:00 committed by GitHub
parent 5e1e320cee
commit bc6bcc3caf
4 changed files with 17 additions and 20 deletions

View File

@ -1,21 +1,5 @@
package org.baeldung.boot.boottest;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.hasSize;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import java.util.Arrays;
import java.util.List;
import org.baeldung.boot.boottest.Employee;
import org.baeldung.boot.boottest.EmployeeRestController;
import org.baeldung.boot.boottest.EmployeeService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -28,9 +12,22 @@ import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import java.util.Arrays;
import java.util.List;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.hasSize;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@RunWith(SpringRunner.class)
@WebMvcTest(EmployeeRestController.class)
public class EmployeeRestControllerTest {
public class EmployeeControllerIntegrationTest {
@Autowired
private MockMvc mvc;

View File

@ -17,7 +17,7 @@ import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@DataJpaTest
public class EmployeeRepositoryTest {
public class EmployeeRepositoryIntegrationTest {
@Autowired
private TestEntityManager entityManager;

View File

@ -31,7 +31,7 @@ import org.springframework.test.web.servlet.MockMvc;
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = DemoApplication.class)
@AutoConfigureMockMvc
@TestPropertySource(locations = "classpath:application-integrationtest.properties")
public class EmployeeRestControllerIntTest {
public class EmployeeRestControllerIntegrationTest {
@Autowired
private MockMvc mvc;

View File

@ -23,7 +23,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
public class EmployeeServiceImplTest {
public class EmployeeServiceImplIntegrationTest {
@TestConfiguration
static class EmployeeServiceImplTestContextConfiguration {