Class AbstractMatcherAssert<SELF extends AbstractMatcherAssert<SELF>>

java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,Matcher>
org.assertj.core.api.AbstractMatcherAssert<SELF>
All Implemented Interfaces:
Assert<SELF,Matcher>, Descriptable<SELF>, ExtensionPoints<SELF,Matcher>
Direct Known Subclasses:
MatcherAssert

public abstract class AbstractMatcherAssert<SELF extends AbstractMatcherAssert<SELF>> extends AbstractAssert<SELF,Matcher>
Assertions for Matcher
Author:
Jiashu Zhang
  • Constructor Details

    • AbstractMatcherAssert

      protected AbstractMatcherAssert(Matcher actual, Class<?> selfType)
  • Method Details

    • matches

      public SELF matches()
      Verifies that the Matcher matches.

      Example:

       // Assertion succeeds:
       Pattern pattern = Pattern.compile("a*");
       Matcher matcher = pattern.matcher("aaa");
       assertThat(matcher).matches();
       
       // Assertion fails:
       Pattern pattern = Pattern.compile("a*");
       Matcher matcher = pattern.matcher("abc");
       assertThat(matcher).matches();
      Returns:
      this assertion object.
      Throws:
      AssertionError - if actual does not match.
      AssertionError - if actual is null.
      Since:
      3.23.0