[Bael 6514] - Fixed missing usage (#4284)
* Added parent module on poms that have no parent defined * Removed dependency reduced pom from undertow module * [BAEL-6514] - Fix usage of @AutoConfigureMockMvc without mocking * [BAEL-6514] - Fix usage of @AutoConfigureMockMvc without mocking * [BAEL-6514] - Fix usage of @AutoConfigureMockMvc without mocking
This commit is contained in:
parent
110d3891c4
commit
a6c5f89093
|
@ -20,7 +20,6 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringBootAnnotatedApp.class)
|
||||
@AutoConfigureMockMvc
|
||||
@TestPropertySource(properties = { "security.basic.enabled=false" })
|
||||
public class SpringBootWithServletComponentIntegrationTest {
|
||||
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
package com.baeldung.annotation.servletcomponentscan;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import javax.servlet.FilterRegistration;
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
@ -11,16 +17,8 @@ import org.springframework.http.ResponseEntity;
|
|||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import javax.servlet.FilterRegistration;
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringBootPlainApp.class)
|
||||
@AutoConfigureMockMvc
|
||||
@TestPropertySource(properties = { "security.basic.enabled=false" })
|
||||
public class SpringBootWithoutServletComponentIntegrationTest {
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
|||
import org.springframework.web.context.WebApplicationContext;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = Application.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK, classes = Application.class)
|
||||
@AutoConfigureMockMvc
|
||||
public class ShutdownApplicationTest {
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import javax.servlet.ServletContext;
|
|||
import static org.junit.Assert.*;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringBootAnnotatedApp.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK, classes = SpringBootAnnotatedApp.class)
|
||||
@AutoConfigureMockMvc
|
||||
@TestPropertySource(properties = { "security.basic.enabled=false" })
|
||||
public class SpringBootWithServletComponentIntegrationTest {
|
||||
|
|
|
@ -16,7 +16,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK)
|
||||
@AutoConfigureMockMvc
|
||||
@TestPropertySource(properties = { "security.basic.enabled=false" })
|
||||
public class AppLiveTest {
|
||||
|
|
Loading…
Reference in New Issue