Class HeaderValue
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.junit.internal.matchers.TypeSafeMatcher<com.meterware.httpunit.WebResponse>
com.atlassian.jira.functest.matcher.HeaderValue
- All Implemented Interfaces:
org.hamcrest.Matcher<com.meterware.httpunit.WebResponse>
,org.hamcrest.SelfDescribing
public class HeaderValue
extends org.junit.internal.matchers.TypeSafeMatcher<com.meterware.httpunit.WebResponse>
Matcher that checks that the response contains a specific HTTP header with the given value.
- Since:
- v4.3
-
Constructor Summary
ConstructorDescriptionHeaderValue
(String headerName, org.hamcrest.Matcher<? super String> headerValue) Creates a new HasHeaderWithValue matcher. -
Method Summary
Modifier and TypeMethodDescriptionvoid
describeTo
(org.hamcrest.Description description) static org.hamcrest.Matcher<com.meterware.httpunit.WebResponse>
Asserts that a WebResponse has a header with the given value.boolean
matchesSafely
(com.meterware.httpunit.WebResponse response) Methods inherited from class org.junit.internal.matchers.TypeSafeMatcher
matches
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString
-
Constructor Details
-
HeaderValue
Creates a new HasHeaderWithValue matcher.- Parameters:
headerName
- a String containing the header's nameheaderValue
- a Matcherfor the header's value
-
-
Method Details
-
header
public static org.hamcrest.Matcher<com.meterware.httpunit.WebResponse> header(String headerName, org.hamcrest.Matcher<? super String> headerValue) Asserts that a WebResponse has a header with the given value.- Parameters:
headerName
- a String containing the header's expected nameheaderValue
- a String containing the header's expected value- Returns:
- a new Matcher
-
matchesSafely
public boolean matchesSafely(com.meterware.httpunit.WebResponse response) - Specified by:
matchesSafely
in classorg.junit.internal.matchers.TypeSafeMatcher<com.meterware.httpunit.WebResponse>
-
describeTo
public void describeTo(org.hamcrest.Description description)
-