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

    Constructors
    Constructor
    Description
    HeaderValue(String headerName, org.hamcrest.Matcher<? super String> headerValue)
    Creates a new HasHeaderWithValue matcher.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    describeTo(org.hamcrest.Description description)
     
    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.
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • HeaderValue

      public HeaderValue(String headerName, org.hamcrest.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
  • 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 name
      headerValue - 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 class org.junit.internal.matchers.TypeSafeMatcher<com.meterware.httpunit.WebResponse>
    • describeTo

      public void describeTo(org.hamcrest.Description description)