Class ModelAssertion<T>


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

      • ModelAssertion

        public ModelAssertion​(java.lang.Object model)
    • Method Detail

      • checkFieldIsPresent

        protected static void checkFieldIsPresent​(java.lang.Object fieldNameToBeRetuned,
                                                  java.lang.Object fieldValueToBeRetuned)
      • field

        public ModelAssertion.AssertionVerbs field​(java.lang.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:
        java.lang.IllegalStateException - If the field cannot be converted to JSON.