Interface ParameterizedInstantiator<T>
- Type Parameters:
T
- identifying the type of object to be instantiated
- All Known Implementing Classes:
AbstractInlineInstantiator
,AbstractOrderedArgsInstantiator
,BeanInstantiator
,BuilderParameterizedInstantiator
,CallbackAwareInstantiator
,ConstructorBasedInstantiator
,FactoryBasedInstantiator
,InjectedBeanInstantiator
public interface ParameterizedInstantiator<T>
Abstraction of certain ways for creating and populating test-objects .
- Author:
- Oliver Wolff
-
Method Summary
Modifier and TypeMethodDescriptionnewInstance
(List<PropertyMetadata> properties) Similar tonewInstance(List, boolean)
but with the difference that the caller has no control regarding the set / applied properties, that may be need for some asserts.newInstance
(List<PropertySupport> properties, boolean generatePropertyValues) Creates a new Object according to the given parameter, represented asList
ofPropertySupport
-
Method Details
-
newInstance
Creates a new Object according to the given parameter, represented asList
ofPropertySupport
- Parameters:
properties
- to be applied to the newly created object.generatePropertyValues
- indicating whether this method should implicitly callPropertySupport.generateTestValue()
or not. In case beingfalse
the caller must ensure this.- Returns:
- a newly created object with the given properties being applied.
- Throws:
AssertionError
- in case the object could not be created or the properties could not been applied.
-
newInstance
Similar tonewInstance(List, boolean)
but with the difference that the caller has no control regarding the set / applied properties, that may be need for some asserts. It is some kind of any()- Parameters:
properties
- to be applied to the newly created object.- Returns:
- a newly created object with the given properties being applied.
- Throws:
AssertionError
- in case the object could not be created or the properties could not been applied.
-
getRuntimeProperties
- Returns:
- the runtime information associated with this
ParameterizedInstantiator
-
newInstanceMinimal
- Returns:
- a new instance of the object with only required attributes set.
-
newInstanceFull
- Returns:
- a new instance of the object with all attributes set.
-