Class ObjectCreatorContractImpl<T>
java.lang.Object
de.cuioss.test.valueobjects.contract.ObjectCreatorContractImpl<T>
- Type Parameters:
T
- identifying the objects to be tested.
- All Implemented Interfaces:
TestContract<T>
TestContract for dealing Constructor and factories,
VerifyConstructor
and VerifyFactoryMethod
respectively- Author:
- Oliver Wolff
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks the concrete contract.static final <T> List<ObjectCreatorContractImpl<T>>
createTestContracts
(Class<T> beanType, Class<?> annotated, List<PropertyMetadata> initialPropertyMetadata) Factory method for creating aList
of instances ofObjectCreatorContractImpl
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
-
ObjectCreatorContractImpl
public ObjectCreatorContractImpl()
-
-
Method Details
-
assertContract
Description copied from interface:TestContract
Checks the concrete contract.- Specified by:
assertContract
in interfaceTestContract<T>
-
createTestContracts
public static final <T> List<ObjectCreatorContractImpl<T>> createTestContracts(Class<T> beanType, Class<?> annotated, List<PropertyMetadata> initialPropertyMetadata) Factory method for creating aList
of instances ofObjectCreatorContractImpl
depending on the given parameter- Parameters:
beanType
- identifying the type to be tested. Must not be nullannotated
- the annotated unit-test-class. It is expected to be annotated withVerifyConstructor
and / orVerifyConstructors
,VerifyFactoryMethod
and / orVerifyFactoryMethods
otherwise the method will return empty listinitialPropertyMetadata
- identifying the complete set ofPropertyMetadata
, where the actualPropertyMetadata
for the test will be filtered by using the attributes defined withinVerifyConstructor
and / orVerifyFactoryMethod
. Must not be null.- Returns:
- a
List
of instances ofObjectCreatorContractImpl
in case all requirements for the parameters are correct, otherwise it will return an empty list
-