Package org.jvnet.hudson.test
Class JenkinsMatchers
java.lang.Object
org.jvnet.hudson.test.JenkinsMatchers
Some handy matchers.
- Since:
- 1.436
- Author:
- Stephen Connolly
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.hamcrest.Matcher<hudson.util.FormValidation>
static org.hamcrest.Matcher<Throwable>
A matcher that verifies that the a root cause of an exception is of the specified type.static org.hamcrest.Matcher<Object>
hasConsistentEquals
(Object other) static org.hamcrest.Matcher<Class<?>>
A matcher which checks that the class has the default constructor.static org.hamcrest.Matcher<Object>
hasHashCodeContract
(Object other) static org.hamcrest.Matcher<Object>
static org.hamcrest.Matcher<Object>
static org.hamcrest.Matcher<hudson.util.FormValidation>
hasKind
(hudson.util.FormValidation.Kind kind) static org.hamcrest.Matcher<Object>
static org.hamcrest.Matcher<hudson.util.Secret>
hasPlainText
(String expected) Returns a Matcher for the plain text value of a Secret.static org.hamcrest.Matcher<hudson.util.Secret>
hasPlainText
(org.hamcrest.Matcher<? super String> matcher) Returns a Matcher for the plain text value of a Secret.static org.hamcrest.Matcher<Object>
static org.hamcrest.Matcher<Object>
hasSymmetricEquals
(Object other) static org.hamcrest.Matcher<Object>
hasTransitiveEquals
(Object a, Object b) static org.hamcrest.Matcher<Class<?>>
A matcher which checks that the class has only private constructors.static org.hamcrest.Matcher<Class<?>>
A matcher which checks that the class is final.static org.hamcrest.Matcher<Class<?>>
A matcher which checks that the class is a Utility class (i.e.static org.hamcrest.Matcher<String>
matchesPattern
(String pattern) Returns a Matcher that matches against the given pattern usingMatcher.find()
.static org.hamcrest.Matcher<Class<?>>
privateConstructorThrows
(Class<? extends Throwable> cause)
-
Constructor Details
-
JenkinsMatchers
public JenkinsMatchers()
-
-
Method Details
-
privateConstructorThrows
-
causedBy
-
hasKind
public static org.hamcrest.Matcher<hudson.util.FormValidation> hasKind(hudson.util.FormValidation.Kind kind) -
isUtilityClass
A matcher which checks that the class is a Utility class (i.e. is final and has only private constructors).- Returns:
- A matcher which checks that the class is a Utility class (i.e. is final and has only private constructors).
-
isClassWithOnlyPrivateConstructors
A matcher which checks that the class has only private constructors.- Returns:
- A matcher which checks that the class has only private constructors.
-
isFinalClass
A matcher which checks that the class is final.- Returns:
- A matcher which checks that the class is final.
-
hasDefaultConstructor
A matcher which checks that the class has the default constructor.- Returns:
- A matcher which checks that the class has the default constructor.
-
hasCause
A matcher that verifies that the a root cause of an exception is of the specified type.- Parameters:
cause
- the type of exception that caused this.- Returns:
- A matcher that verifies that the a root cause of an exception is of the specified type.
-
hasImplementedEquals
-
hasReflexiveEquals
-
hasNonEqualityWithNulls
-
hasSymmetricEquals
-
hasConsistentEquals
-
hasTransitiveEquals
-
hasImplementedHashCode
-
hasHashCodeContract
-
hasPlainText
public static org.hamcrest.Matcher<hudson.util.Secret> hasPlainText(org.hamcrest.Matcher<? super String> matcher) Returns a Matcher for the plain text value of a Secret.- Since:
- 2.50
-
hasPlainText
Returns a Matcher for the plain text value of a Secret.- Since:
- 2.50
-
matchesPattern
Returns a Matcher that matches against the given pattern usingMatcher.find()
.- Since:
- 2.50
-