Code example for MockMvc

Methods: perform

0
	} 
 
	@Test
	public void test() throws Exception {
		this.servletRequest.setAttribute("foo1", "bar");
		this.mockMvc.perform(get("/myUrl").requestAttr("foo2", "bar")).andExpect(status().isOk());
	} 
 
 
	@Configuration 
	@EnableWebMvc 
	static class WebConfig extends WebMvcConfigurerAdapter {
 
		@Bean 
		public MyController myController() { 
			return new MyController(); 
		} 
	} 
 
	@Controller