@SuppressWarnings("unchecked") @Test public void headerContains() throws Exception { this.request.getHeaders().put("foo", Arrays.asList("bar", "baz")); MockRestRequestMatchers.header("foo", containsString("ba")).match(this.request); }
@SuppressWarnings("unchecked") @Test(expected = AssertionError.class) public void headerContainsWithMissingValue() throws Exception { this.request.getHeaders().put("foo", Arrays.asList("bar", "baz")); MockRestRequestMatchers.header("foo", containsString("bx")).match(this.request); }
@Test(expected = AssertionError.class) public void headerMissingValue() throws Exception { this.request.getHeaders().put("foo", Arrays.asList("bar", "baz")); MockRestRequestMatchers.header("foo", "bad").match(this.request); }
@Test(expected = AssertionError.class) public void headerMissing() throws Exception { MockRestRequestMatchers.header("foo", "bar").match(this.request); }
@Test public void header() throws Exception { this.request.getHeaders().put("foo", Arrays.asList("bar", "baz")); MockRestRequestMatchers.header("foo", "bar", "baz").match(this.request); }
@SuppressWarnings("unchecked") @Test(expected = AssertionError.class) public void headerContainsWithMissingHeader() throws Exception { MockRestRequestMatchers.header("foo", containsString("baz")).match(this.request); }