java.lang.Object
uk.org.webcompere.modelassert.json.condition.HasSize
All Implemented Interfaces:
Condition

public class HasSize extends Object implements Condition
A size condition - works out the size of the target
  • Constructor Details

    • HasSize

      public HasSize(int requiredSize)
  • Method Details

    • sizeOf

      public static <A> NumberComparisonDsl<A> sizeOf(Satisfies<A> parentAssertion)
      Switch to Size Condition building context to allow the size to be spec
      Type Parameters:
      A - the type of resulting assertion
      Parameters:
      parentAssertion - the parent assertion to resolve to, when the size is provided
      Returns:
      a NumberComparisonDsl for stipulating the size
    • test

      public Result test(com.fasterxml.jackson.databind.JsonNode json)
      Description copied from interface: Condition
      Execute the test of the condition
      Specified by:
      test in interface Condition
      Parameters:
      json - the json to test
      Returns:
      a Result explaining whether the condition was met and if not, why not
    • describe

      public String describe()
      Description copied from interface: Condition
      Describe the condition
      Specified by:
      describe in interface Condition
      Returns:
      description of the condition