Code example for MockMvc

Methods: perform

0
		this.mockMvc = standaloneSetup(this.personController).build(); 
	} 
 
	@Test 
	public void stringWithCorrectResponseHeaderValue() throws Exception { 
		this.mockMvc.perform(get("/persons/1").header(IF_MODIFIED_SINCE, currentTime - (1000 * 60)))// 
		.andExpect(header().string(LAST_MODIFIED, String.valueOf(currentTime))); 
	} 
 
	@Test 
	public void stringWithMatcherAndCorrectResponseHeaderValue() throws Exception { 
		this.mockMvc.perform(get("/persons/1").header(IF_MODIFIED_SINCE, currentTime - (1000 * 60)))// 
		.andExpect(header().string(LAST_MODIFIED, equalTo(String.valueOf(currentTime)))); 
	} 
 
	@Test 
	public void longValueWithCorrectResponseHeaderValue() throws Exception { 
		this.mockMvc.perform(get("/persons/1").header(IF_MODIFIED_SINCE, currentTime - (1000 * 60)))// 
		.andExpect(header().longValue(LAST_MODIFIED, currentTime)); 
	} 
Contextual code suggestions in your IDE  Get Codota for Java