* commit first as binodpanta

* revert test change

* A short example of real-time event streaming using Spring WebFlux

* Code for http://jira.baeldung.com/browse/BAEL-1527

* remove unrelated files

* Apply feedback changes to rename test and remove link from readme file, ongoing work

* Update formatting fixes to code and add pom changes, that partially fix test runnning issues in IDE but not in cmdline

* Apply Eclipse formatter to test code and apply suggested pom fixes

* BAEL-1527 Formatting fix in pom.xml

* Use string.format to cleanup logging code

* BAEL-1527 Changed logging pattern

* Start the spring-boot-vue module, WIP

* some small updates with comments

* Add index html template page

* merge pom.xml fixes

* Add integration test with MockMvc to verify index.html content is rendered correctly

* fix up pom merge issues

* merge issues fix for pom

* pom end of file newline
This commit is contained in:
Binod Pant
2018-07-23 17:00:30 -04:00
committed by maibin
parent 977a92ef0e
commit 896a2d071a
9 changed files with 248 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
package com.baeldung.springbootmvc;
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.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import static org.hamcrest.CoreMatchers.containsString;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
public class SpringBootMvcApplicationTests {
@Autowired
private MockMvc mockMvc;
/**
* If this test passes, we got a page with the thymeleaf provided variable
* value for eventName
*/
@Test
public void shouldLoadCorrectIndexPage() throws Exception {
mockMvc.perform(get("/")).andExpect(status().isOk()).
andExpect(MockMvcResultMatchers.content()
.string(containsString("FIFA 2018")));
}
}