src/test/java/com/dimitri/app/CalculatorApplicationTests.java
/**
	 * Tests posting to logout endpoint. Spring security Post requests require csrf.
	 * <p>
	 * The test behavior is different than a real web browser as they will receive 302.
	 * @throws Exception if response is not 204
	 */
Tests posting to logout endpoint. Spring security Post requests require csrf.

The test behavior is different than a real web browser as they will receive 302.
@throws Exception if response is not 204
Tests posting to logout endpoint . Spring security Post requests require csrf . The test behavior is different than a real web browser as they will receive 302 . @throws Exception if response is not 204
@Test
	@WithMockUser
	public void testLogout() throws Exception {
		this.mockMvc.perform(post("/logout").with(csrf()))
		.andExpect(status().isNoContent());
	}
@ Test @ WithMockUser public void testLogout ( ) throws Exception { this . mockMvc . perform ( post ( "/logout" ) . with ( csrf ( ) ) ) . andExpect ( status ( ) . isNoContent ( ) ) ; }
Tests posting to logout endpoint.
Tests posting to logout endpoint .