All Downloads are FREE. Search and download functionalities are using the official Maven repository.

models.autoRealization.Tests.M1.ReferenceLevel.ReferenceLevel.md Maven / Gradle / Ivy

# Reference Level

## Description

The `ReferenceLevelContext` restricts the realization template to object references at
the root of the realization graph, or to non-root objects reachable through reference 
properties. It defines the following subtypes:

* `RootObjectContext` matches an object reference at the root 
  of a realization graph. This is the object bound directly to a resource, or to a 
  type-bound request or response message. The `RootObjectContext` does not include any 
  dependent matching criteria.
  
* `ReferencePropertyContext` matches reference properties 
  occurring somewhere under the root object in the realization graph. 
  `ReferencePropertyContext` allows additional matching criteria to select a subset 
  of reference properties.

## Prerequisites

This test suite builds on the `ExclusivePropertySet` tests.

## Tests

### RootOnly

Description
The resourceAPI defines only one resource, which is `TaxFilingObject`. It also defines a 404 response bound to the `ErrorResponse` data structure. The realizationModel defines two realization templates: * **`RootObjects`** is filtered to root-level references, and includes all properties. This template should apply to `TaxFiling` at the root of `TaxFilingObject`, and to `ErrorResponse` at the root of the 404 GET response. * **`ReferencedObject`** is filtered to non-root reference properties. It includes only reference properties, and so should create an empty object realization of `Person`, referenced through `TaxFiling.taxpayer`. (The Person realization is an empty object, because it has no reference properties; therefore all of its properties are excluded.)
RAPID Model
ExclusivePropertySet_RootOnly.rapid
Assertions
``` RootOnly model.tbTaxFilingObject.check [ named("TaxFiling_Root").selects("RootObjects") withProps [ including("filingID", "jurisdiction", "year", "period", "currency", "grossIncome", "taxLiability") includingRef("taxpayer") [ named("Person_Ref").selects("ReferencedObjects") withNoProps ] checkedAll ] ].thenCheck(model.tbTaxFilingObject.get_Method.response(404)) [ named("ErrorResponse_Root").selects("RootObjects") withOnlyProps("errorCode", "httpResponseCode", "message") ] ```
### RootsAndRefs
Description
The resourceAPI defines only one resource, which is `TaxFilingObject`. It also defines a 404 response bound to the `ErrorResponse` data structure. The realizationModel defines two realization templates: * **`RootObjects`**, filtered to root-level objects, has only reference properties. This template should apply to `TaxFiling` at the root of `TaxFilingObject`, and to `ErrorResponse` at the root of the 404 GET response. The `ErrorResponse` realization is an empty object, because it has no reference properties. * **`ReferencedObject`** is filtered to non-root object references, and includes only primitive properties. It should apply to `Person`, referenced through `TaxFiling.taxpayer`.
RAPID Model
ExclusivePropertySet_RootsAndRefs.rapid
Assertions
``` RootsAndRefs model.tbTaxFilingObject.check [ named("TaxFiling_Root").selects("RootObjects") withProps [ includingRef("taxpayer") [ named("Person_Ref").selects("ReferencedObjects") withOnlyProps("taxpayerID", "lastName", "firstName", "otherNames") ] checkedAll ] ].thenCheck(model.tbTaxFilingObject.get_Method.response(404)) [ named("ErrorResponse_Root").selects("RootObjects") withNoProps ] ```




© 2015 - 2025 Weber Informatics LLC | Privacy Policy