Class BeanPropertyContractImpl<T>
java.lang.Object
de.cuioss.test.valueobjects.contract.BeanPropertyContractImpl<T>
- Type Parameters:
T
- Rule does not apply to annotations: There is no inheritance
- All Implemented Interfaces:
TestContract<T>
Tests all given properties according to the given List of
PropertyMetadata
- Author:
- Oliver Wolff
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks the concrete contract.static final <T> Optional<TestContract<T>>
createBeanPropertyTestContract
(Class<T> beanType, Class<?> annotated, List<PropertyMetadata> initialPropertyMetadata) Factory method for creating an instance ofBeanPropertyContractImpl
depending on the given parameterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.cuioss.test.valueobjects.api.TestContract
getInstantiator
-
Constructor Details
-
BeanPropertyContractImpl
public BeanPropertyContractImpl()
-
-
Method Details
-
assertContract
Description copied from interface:TestContract
Checks the concrete contract.- Specified by:
assertContract
in interfaceTestContract<T>
-
createBeanPropertyTestContract
public static final <T> Optional<TestContract<T>> createBeanPropertyTestContract(Class<T> beanType, Class<?> annotated, List<PropertyMetadata> initialPropertyMetadata) Factory method for creating an instance ofBeanPropertyContractImpl
depending on the given parameter- Parameters:
beanType
- identifying the type to be tested. Must not be null and must provide a no args public constructorannotated
- the annotated unit-test-class. It is expected to be annotated withBeanPropertyContractImpl
, otherwise the method will returnOptional.empty()
initialPropertyMetadata
- identifying the complete set ofPropertyMetadata
, where the actualPropertyMetadata
for the bean tests will be filtered by using the attributes defined withinBeanPropertyContractImpl
. Must not be null. If it is empty the method will returnOptional.empty()
- Returns:
- an instance Of
BeanPropertyContractImpl
in case all requirements for the parameters are correct, otherwise it will returnOptional.empty()
-