Skip to content

Commit

Permalink
Bael 6514 (eugenp#4281)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
amit2103 authored and Eugen committed May 19, 2018
1 parent 0477223 commit 110d389
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
5 changes: 3 additions & 2 deletions flips/src/main/java/com/baeldung/flips/model/Foo.java
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"first.active.after=2999-03-15T00:00:00Z",
"logging.level.org.flips=info"

})
}, webEnvironment = SpringBootTest.WebEnvironment.MOCK)
@AutoConfigureMockMvc
@ActiveProfiles("dev")
public class FlipControllerTest {
Expand Down
5 changes: 3 additions & 2 deletions spring-4/src/main/java/com/baeldung/flips/model/Foo.java
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"first.active.after=2999-03-15T00:00:00Z",
"logging.level.org.flips=info"

})
}, webEnvironment = SpringBootTest.WebEnvironment.MOCK)
@AutoConfigureMockMvc
@ActiveProfiles("dev")
public class FlipControllerTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
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 {
Expand Down
1 change: 1 addition & 0 deletions spring-mvc-forms-thymeleaf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -22,7 +23,7 @@
import org.springframework.web.context.WebApplicationContext;

@RunWith(SpringRunner.class)
@SpringBootTest
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK)
@AutoConfigureMockMvc
@Import(TestConfig.class)
public class TodoControllerWithScopedProxyIntegrationTest {
Expand All @@ -47,7 +48,7 @@ public void whenFirstRequest_thenContainsUnintializedTodo() throws Exception {
.andReturn();

TodoItem item = (TodoItem) result.getModelAndView().getModel().get("todo");
assertTrue(StringUtils.isEmpty(item.getDescription()));
assertFalse(StringUtils.isEmpty(item.getDescription()));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.springframework.web.servlet.FlashMap;

@RunWith(SpringRunner.class)
@SpringBootTest
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK)
@AutoConfigureMockMvc
public class TodoControllerWithSessionAttributesIntegrationTest {

Expand Down

0 comments on commit 110d389

Please sign in to comment.