Bael 6514 (#4281)
* 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
This commit is contained in:
parent
047722347e
commit
110d3891c4
|
@ -1,11 +1,12 @@
|
|||
package com.baeldung.flips.model;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Data
|
||||
@RequiredArgsConstructor
|
||||
public class Foo {
|
||||
private final String name;
|
||||
private final int id;
|
||||
@NonNull private final String name;
|
||||
@NonNull private final int id;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
|
|||
"first.active.after=2999-03-15T00:00:00Z",
|
||||
"logging.level.org.flips=info"
|
||||
|
||||
})
|
||||
}, webEnvironment = SpringBootTest.WebEnvironment.MOCK)
|
||||
@AutoConfigureMockMvc
|
||||
@ActiveProfiles("dev")
|
||||
public class FlipControllerTest {
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package com.baeldung.flips.model;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Data
|
||||
@RequiredArgsConstructor
|
||||
public class Foo {
|
||||
private final String name;
|
||||
private final int id;
|
||||
@NonNull private final String name;
|
||||
@NonNull private final int id;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
|
|||
"first.active.after=2999-03-15T00:00:00Z",
|
||||
"logging.level.org.flips=info"
|
||||
|
||||
})
|
||||
}, webEnvironment = SpringBootTest.WebEnvironment.MOCK)
|
||||
@AutoConfigureMockMvc
|
||||
@ActiveProfiles("dev")
|
||||
public class FlipControllerTest {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.baeldung.sessionattrs;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||
|
@ -22,7 +23,7 @@ import org.springframework.util.StringUtils;
|
|||
import org.springframework.web.context.WebApplicationContext;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK)
|
||||
@AutoConfigureMockMvc
|
||||
@Import(TestConfig.class)
|
||||
public class TodoControllerWithScopedProxyIntegrationTest {
|
||||
|
@ -47,7 +48,7 @@ public class TodoControllerWithScopedProxyIntegrationTest {
|
|||
.andReturn();
|
||||
|
||||
TodoItem item = (TodoItem) result.getModelAndView().getModel().get("todo");
|
||||
assertTrue(StringUtils.isEmpty(item.getDescription()));
|
||||
assertFalse(StringUtils.isEmpty(item.getDescription()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.springframework.web.context.WebApplicationContext;
|
|||
import org.springframework.web.servlet.FlashMap;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK)
|
||||
@AutoConfigureMockMvc
|
||||
public class TodoControllerWithSessionAttributesIntegrationTest {
|
||||
|
||||
|
|
Loading…
Reference in New Issue