Package org.alfresco.rest.core.assertion
Class ModelAssertion<T>
- java.lang.Object
-
- org.alfresco.rest.core.assertion.ModelAssertion<T>
-
public class ModelAssertion<T> extends java.lang.ObjectAssertion on Rest Model Just pass your rest model as constructor- Author:
- Paul Brodner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classModelAssertion.AssertionItemVerbsclassModelAssertion.AssertionVerbsDSL assertion on Rest Model fieldsstatic classModelAssertion.Operation
-
Constructor Summary
Constructors Constructor Description ModelAssertion(java.lang.Object model)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static voidcheckFieldIsPresent(java.lang.Object fieldNameToBeRetuned, java.lang.Object fieldValueToBeRetuned)ModelAssertion.AssertionVerbsfield(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") ModelAssertion.AssertionItemVerbsfieldsCount()
-
-
-
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.
-
fieldsCount
public ModelAssertion.AssertionItemVerbs fieldsCount() throws java.lang.Exception
- Throws:
java.lang.Exception
-
-