Class ModelAssertion<T>

java.lang.Object
org.alfresco.rest.core.assertion.ModelAssertion<T>

public class ModelAssertion<T> extends Object
Assertion on Rest Model Just pass your rest model as constructor
Author:
Paul Brodner
  • Constructor Details

    • ModelAssertion

      public ModelAssertion(Object model)
  • Method Details

    • checkFieldIsPresent

      protected static void checkFieldIsPresent(Object fieldNameToBeRetuned, Object fieldValueToBeRetuned)
    • field

      public ModelAssertion<T>.AssertionVerbs field(String fieldName)
      Use this DSL for asserting particular fields of your model if your model is like this (basic POJO) public class Person extends ModelAssertion { private String id = "1234"; you can use assert the id of this person as: Person p = new Person(); p.assertField("id").is("1234")
      Parameters:
      fieldName -
      Returns:
      Throws:
      IllegalStateException - If the field cannot be converted to JSON.
    • fieldsCount

      public ModelAssertion<T>.AssertionItemVerbs fieldsCount()