Class Matchers

java.lang.Object
org.hamcrest.CoreMatchers
com.onenetwork.platform.tools.test.Matchers

public class Matchers
extends org.hamcrest.CoreMatchers
Hookpoint class enabling use of org.hamcrest Matchers in test framework.
Example usage:
import static com.onenetwork.platform.tools.test.Matchers.assertThat; import static com.onenetwork.platform.tools.test.Matchers.equalTo; import static com.onenetwork.platform.tools.test.Matchers.not; ... assertThat(1, not(equalTo(2)));
  • Constructor Summary

    Constructors 
    Constructor Description
    Matchers()  
  • Method Summary

    Modifier and Type Method Description
    static <T> org.hamcrest.Matcher<T> anyOf​(T... values)
    Matches if value is equal to any of values provided
    static <T> void assertThat​(java.lang.String message, T actual, org.hamcrest.Matcher<T> matcher)
    Deprecated.
    use MatcherAssert.assertThat(String, Object, Matcher) directly
    static <T> void assertThat​(T actual, org.hamcrest.Matcher<T> matcher)
    Deprecated.
    use org.hamcrest.MatcherAssert#assertThat(String, Matcher) directly

    Methods inherited from class org.hamcrest.CoreMatchers

    allOf, allOf, allOf, allOf, allOf, allOf, allOf, any, anyOf, anyOf, anyOf, anyOf, anyOf, anyOf, anyOf, anything, anything, both, containsString, describedAs, either, endsWith, equalTo, everyItem, hasItem, hasItem, hasItems, hasItems, instanceOf, is, is, is, isA, not, not, notNullValue, notNullValue, nullValue, nullValue, sameInstance, startsWith, theInstance

    Methods inherited from class java.lang.Object

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

  • Method Details

    • assertThat

      public static <T> void assertThat​(T actual, org.hamcrest.Matcher<T> matcher)
      Deprecated.
      use org.hamcrest.MatcherAssert#assertThat(String, Matcher) directly
      Tests that actual object matches the {@code matcher
      Type Parameters:
      T -
      Parameters:
      actual -
      matcher -
      Throws:
      java.lang.AssertionError - if actual object does not match
      See Also:
      Matchers
    • assertThat

      public static <T> void assertThat​(java.lang.String message, T actual, org.hamcrest.Matcher<T> matcher)
      Deprecated.
      use MatcherAssert.assertThat(String, Object, Matcher) directly
      Tests that actual object matches the matcher
      Type Parameters:
      T -
      Parameters:
      message -
      actual -
      matcher -
      Throws:
      java.lang.AssertionError - if actual object does not match
      See Also:
      Matchers
    • anyOf

      @SafeVarargs public static <T> org.hamcrest.Matcher<T> anyOf​(T... values)
      Matches if value is equal to any of values provided
      Type Parameters:
      T -
      Parameters:
      values -
      Returns: