Skip to content

Commit a6c5f89

Browse files
amit2103Eugen
authored andcommitted
[Bael 6514] - Fixed missing usage (eugenp#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
1 parent 110d389 commit a6c5f89

5 files changed

Lines changed: 10 additions & 13 deletions

File tree

‎spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
@RunWith(SpringRunner.class)
2222
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringBootAnnotatedApp.class)
23-
@AutoConfigureMockMvc
2423
@TestPropertySource(properties = { "security.basic.enabled=false" })
2524
public class SpringBootWithServletComponentIntegrationTest {
2625

‎spring-boot/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithoutServletComponentIntegrationTest.java‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
package com.baeldung.annotation.servletcomponentscan;
22

3+
import static org.junit.Assert.assertEquals;
4+
import static org.junit.Assert.assertNotNull;
5+
import static org.junit.Assert.assertNull;
6+
7+
import javax.servlet.FilterRegistration;
8+
import javax.servlet.ServletContext;
9+
310
import org.junit.Test;
411
import org.junit.runner.RunWith;
512
import org.springframework.beans.factory.annotation.Autowired;
6-
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
713
import org.springframework.boot.test.context.SpringBootTest;
814
import org.springframework.boot.test.web.client.TestRestTemplate;
915
import org.springframework.http.HttpStatus;
1016
import org.springframework.http.ResponseEntity;
1117
import org.springframework.test.context.TestPropertySource;
1218
import org.springframework.test.context.junit4.SpringRunner;
1319

14-
import javax.servlet.FilterRegistration;
15-
import javax.servlet.ServletContext;
16-
17-
import static org.junit.Assert.assertEquals;
18-
import static org.junit.Assert.assertNotNull;
19-
import static org.junit.Assert.assertNull;
20-
2120
@RunWith(SpringRunner.class)
2221
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringBootPlainApp.class)
23-
@AutoConfigureMockMvc
2422
@TestPropertySource(properties = { "security.basic.enabled=false" })
2523
public class SpringBootWithoutServletComponentIntegrationTest {
2624

‎spring-boot/src/test/java/com/baeldung/shutdown/ShutdownApplicationTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import org.springframework.web.context.WebApplicationContext;
1717

1818
@RunWith(SpringJUnit4ClassRunner.class)
19-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = Application.class)
19+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK, classes = Application.class)
2020
@AutoConfigureMockMvc
2121
public class ShutdownApplicationTest {
2222

‎spring-custom-aop/src/test/java/com/baeldung/annotation/servletcomponentscan/SpringBootWithServletComponentIntegrationTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import static org.junit.Assert.*;
1818

1919
@RunWith(SpringRunner.class)
20-
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = SpringBootAnnotatedApp.class)
20+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK, classes = SpringBootAnnotatedApp.class)
2121
@AutoConfigureMockMvc
2222
@TestPropertySource(properties = { "security.basic.enabled=false" })
2323
public class SpringBootWithServletComponentIntegrationTest {

‎spring-custom-aop/src/test/java/com/baeldung/intro/AppLiveTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
1717

1818
@RunWith(SpringRunner.class)
19-
@SpringBootTest
19+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK)
2020
@AutoConfigureMockMvc
2121
@TestPropertySource(properties = { "security.basic.enabled=false" })
2222
public class AppLiveTest {

0 commit comments

Comments
 (0)