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 Details

    • newInstance

      T newInstance(List<PropertySupport> properties, boolean generatePropertyValues)
      Creates a new Object according to the given parameter, represented as List of PropertySupport
      Parameters:
      properties - to be applied to the newly created object.
      generatePropertyValues - indicating whether this method should implicitly call PropertySupport.generateTestValue() or not. In case being false 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 to newInstance(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.