|
|
|
|
@ -154,6 +154,16 @@ public class HeaderAssertionTests {
@@ -154,6 +154,16 @@ public class HeaderAssertionTests {
|
|
|
|
|
this.mockMvc.perform(get("/persons/1")).andExpect(header().doesNotExist(LAST_MODIFIED)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void doesExist() throws Exception { |
|
|
|
|
this.mockMvc.perform(get("/persons/1")).andExpect(header().doesExist(LAST_MODIFIED)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test(expected = AssertionError.class) // SPR-10771
|
|
|
|
|
public void doesExistFail() throws Exception { |
|
|
|
|
this.mockMvc.perform(get("/persons/1")).andExpect(header().doesExist("X-Custom-Header")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void stringWithIncorrectResponseHeaderValue() throws Exception { |
|
|
|
|
assertIncorrectResponseHeader(header().string(LAST_MODIFIED, secondLater), secondLater); |
|
|
|
|
|