Interface TextNodeDsl<A>

Type Parameters:
A - the final assertion
All Superinterfaces:
Satisfies<A>, Sizeable<A>
All Known Subinterfaces:
JsonNodeAssertDsl<A>
All Known Implementing Classes:
AssertJson, ConditionList, CoreJsonAssertion, HamcrestJsonAssertion, HamcrestJsonAssertionBuilder, JsonAssertDslBuilders.At, PathDsl, TextNodes

public interface TextNodeDsl<A> extends Satisfies<A>, Sizeable<A>
Test node specific assertions
  • Method Summary

    Modifier and Type
    Method
    Description
    default A
    Assert that the node is text and empty
    default A
    Assert that the node is text and is not empty
    default A
    Assert that the node is not a text node
    default A
    Assert that the node is a text node with value different to the given one
    default A
    Assert that the node is a text node
    default A
    isText(String text)
    Assert that the node is a text node with a given value
    default A
    matches(String regex)
    Assert that the text matches a regular expression
    default A
    Assert that the node is text matching a regular expression
    default A
    Assert that the value is text, meeting an additional condition
    default A
    textContains(String substring)
    Assert that the text of this node contains a substring
    default A
    Assert that the text of this node contains a substring
    default A
    Assert that the text of this node does not start with a substring
    default A
    textMatches(String conditionName, Predicate<String> predicate)
    Assert that the text matches a custom predicate
    default A
    Assert that the text of this node starts with a substring

    Methods inherited from interface uk.org.webcompere.modelassert.json.dsl.Satisfies

    satisfies, satisfies

    Methods inherited from interface uk.org.webcompere.modelassert.json.dsl.nodespecific.Sizeable

    hasSize, isEmpty, size
  • Method Details

    • satisfiesTextCondition

      default A satisfiesTextCondition(Condition condition)
      Assert that the value is text, meeting an additional condition
      Parameters:
      condition - the number condition
      Returns:
      the assertion for fluent assertions, with this condition added
    • matches

      default A matches(Pattern regex)
      Assert that the node is text matching a regular expression
      Parameters:
      regex - the expression
      Returns:
      the assertion for fluent assertions, with this condition added
    • matches

      default A matches(String regex)
      Assert that the text matches a regular expression
      Parameters:
      regex - the expression
      Returns:
      the assertion for fluent assertions, with this condition added
    • textMatches

      default A textMatches(String conditionName, Predicate<String> predicate)
      Assert that the text matches a custom predicate
      Parameters:
      conditionName - the name of the condition
      predicate - the required condition
      Returns:
      the assertion for fluent assertions, with this condition added
    • isText

      default A isText()
      Assert that the node is a text node
      Returns:
      the assertion for fluent assertions, with this condition added
    • isText

      default A isText(String text)
      Assert that the node is a text node with a given value
      Parameters:
      text - the expected value
      Returns:
      the assertion for fluent assertions, with this condition added
    • isNotText

      default A isNotText()
      Assert that the node is not a text node
      Returns:
      the assertion for fluent assertions, with this condition added
    • isNotText

      default A isNotText(String text)
      Assert that the node is a text node with value different to the given one
      Parameters:
      text - the expected value
      Returns:
      the assertion for fluent assertions, with this condition added
    • isEmptyText

      default A isEmptyText()
      Assert that the node is text and empty
      Returns:
      the assertion for fluent assertions, with this condition added
    • isNotEmptyText

      default A isNotEmptyText()
      Assert that the node is text and is not empty
      Returns:
      the assertion for fluent assertions, with this condition added
    • textContains

      default A textContains(String substring)
      Assert that the text of this node contains a substring
      Parameters:
      substring - the substring to find
      Returns:
      the assertion for fluent assertions, with this condition added
    • textDoesNotContain

      default A textDoesNotContain(String substring)
      Assert that the text of this node contains a substring
      Parameters:
      substring - the substring to find
      Returns:
      the assertion for fluent assertions, with this condition added
    • textStartsWith

      default A textStartsWith(String substring)
      Assert that the text of this node starts with a substring
      Parameters:
      substring - the substring to find
      Returns:
      the assertion for fluent assertions, with this condition added
    • textDoesNotStartWith

      default A textDoesNotStartWith(String substring)
      Assert that the text of this node does not start with a substring
      Parameters:
      substring - the substring to find
      Returns:
      the assertion for fluent assertions, with this condition added