public class

HeaderValue

extends TypeSafeMatcher<T>
java.lang.Object
   ↳ org.hamcrest.BaseMatcher<T>
     ↳ org.junit.internal.matchers.TypeSafeMatcher<T>
       ↳ com.atlassian.jira.functest.matcher.HeaderValue

Class Overview

Matcher that checks that the response contains a specific HTTP header with the given value.

Summary

Public Constructors
HeaderValue(String headerName, Matcher<? super String> headerValue)
Creates a new HasHeaderWithValue matcher.
Public Methods
void describeTo(Description description)
static Matcher<WebResponse> header(String headerName, Matcher<? super String> headerValue)
Asserts that a WebResponse has a header with the given value.
boolean matchesSafely(WebResponse response)
[Expand]
Inherited Methods
From class org.junit.internal.matchers.TypeSafeMatcher
From class org.hamcrest.BaseMatcher
From class java.lang.Object
From interface org.hamcrest.Matcher
From interface org.hamcrest.SelfDescribing

Public Constructors

public HeaderValue (String headerName, Matcher<? super String> headerValue)

Creates a new HasHeaderWithValue matcher.

Parameters
headerName a String containing the header's name
headerValue a Matcher for the header's value

Public Methods

public void describeTo (Description description)

public static Matcher<WebResponse> header (String headerName, Matcher<? super String> headerValue)

Asserts that a WebResponse has a header with the given value.

Parameters
headerName a String containing the header's expected name
headerValue a String containing the header's expected value
Returns
  • a new Matcher

public boolean matchesSafely (WebResponse response)