Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/hello/GreetingController.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@RestController
public class GreetingController {

private static final String template = "Hello there, %s!";
private static final String template = "Hello again there, %s!";
private final AtomicLong counter = new AtomicLong();

@RequestMapping("/greeting")
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/hello/GreetingControllerTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ public class GreetingControllerTests {
public void noParamGreetingShouldReturnDefaultMessage() throws Exception {

this.mockMvc.perform(get("/greeting")).andDo(print()).andExpect(status().isOk())
.andExpect(jsonPath("$.content").value("Hello there, World!"));
.andExpect(jsonPath("$.content").value("Hello again there, World!"));
}

@Test
public void paramGreetingShouldReturnTailoredMessage() throws Exception {

this.mockMvc.perform(get("/greeting").param("name", "Spring Community"))
.andDo(print()).andExpect(status().isOk())
.andExpect(jsonPath("$.content").value("Hello there, Spring Community!"));
.andExpect(jsonPath("$.content").value("Hello again there, Spring Community!"));
}

}