Search in sources :

Example 1 with AbstractAssociation

use of org.qi4j.api.association.AbstractAssociation in project qi4j-sdk by Qi4j.

the class Qi4jSPITest method validateState.

private void validateState(AssociationStateHolder state, EntityDescriptor entityDescriptor) {
    for (PropertyDescriptor propertyDescriptor : entityDescriptor.state().properties()) {
        Property<?> prop = state.propertyFor(propertyDescriptor.accessor());
        assertThat("Properties could be listed", prop, CoreMatchers.notNullValue());
    }
    AssociationStateDescriptor descriptor = entityDescriptor.state();
    for (AssociationDescriptor associationDescriptor : descriptor.associations()) {
        AbstractAssociation assoc = state.associationFor(associationDescriptor.accessor());
        assertThat("Assocs could be listed", assoc, CoreMatchers.notNullValue());
    }
}
Also used : AbstractAssociation(org.qi4j.api.association.AbstractAssociation) PropertyDescriptor(org.qi4j.api.property.PropertyDescriptor) AssociationDescriptor(org.qi4j.api.association.AssociationDescriptor) AssociationStateDescriptor(org.qi4j.api.association.AssociationStateDescriptor)

Aggregations

AbstractAssociation (org.qi4j.api.association.AbstractAssociation)1 AssociationDescriptor (org.qi4j.api.association.AssociationDescriptor)1 AssociationStateDescriptor (org.qi4j.api.association.AssociationStateDescriptor)1 PropertyDescriptor (org.qi4j.api.property.PropertyDescriptor)1