com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client.matcher
Class HasErrorMessage
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.junit.internal.matchers.TypeSafeMatcher<Response>
com.atlassian.jira.webtests.ztests.bundledplugins2.rest.client.matcher.HasErrorMessage
- All Implemented Interfaces:
- org.hamcrest.Matcher<Response>, org.hamcrest.SelfDescribing
public class HasErrorMessage
- extends org.junit.internal.matchers.TypeSafeMatcher<Response>
Matches if the response contains an error message that matches the given matcher.
- Since:
- v4.3
Constructor Summary |
HasErrorMessage(org.hamcrest.Matcher<? super String> errorMessageMatcher)
Creates a new HasErrorMessage matcher. |
Method Summary |
void |
describeTo(org.hamcrest.Description description)
|
static org.hamcrest.Matcher<Response> |
hasErrorMessage(org.hamcrest.Matcher<String> errorMatcher)
Matches a response if it contains an error message that matches the given matcher. |
static org.hamcrest.Matcher<Response> |
hasErrorMessage(String errorMessage)
Matches a response if it contains an error message that is equal to the given string.. |
boolean |
matchesSafely(Response 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 |
HasErrorMessage
public HasErrorMessage(org.hamcrest.Matcher<? super String> errorMessageMatcher)
- Creates a new HasErrorMessage matcher.
- Parameters:
errorMessageMatcher
- a Matcher that will be used for the error message
hasErrorMessage
public static org.hamcrest.Matcher<Response> hasErrorMessage(String errorMessage)
- Matches a response if it contains an error message that is equal to the given string..
- Parameters:
errorMessage
- a String containing the expected error message
- Returns:
- a Matcher
hasErrorMessage
public static org.hamcrest.Matcher<Response> hasErrorMessage(org.hamcrest.Matcher<String> errorMatcher)
- Matches a response if it contains an error message that matches the given matcher.
- Parameters:
errorMatcher
- a Matcher that will be used for the error message
- Returns:
- a Matcher
matchesSafely
public boolean matchesSafely(Response response)
- Specified by:
matchesSafely
in class org.junit.internal.matchers.TypeSafeMatcher<Response>
describeTo
public void describeTo(org.hamcrest.Description description)
Copyright © 2002-2012 Atlassian. All Rights Reserved.