com.atlassian.jira.functest.matcher
Class HeaderValue

java.lang.Object
  extended by org.hamcrest.BaseMatcher<T>
      extended by org.junit.internal.matchers.TypeSafeMatcher<com.meterware.httpunit.WebResponse>
          extended by 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
HeaderValue(String headerName, org.hamcrest.Matcher<? super String> headerValue)
          Creates a new HasHeaderWithValue matcher.
 
Method Summary
 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_, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 Detail

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)


Copyright © 2002-2013 Atlassian. All Rights Reserved.