Package de.cuioss.test.valueobjects.util
Interface GeneratorRegistry
- All Known Implementing Classes:
MapperTest
,PropertyAwareTest
,ValueObjectTest
public interface GeneratorRegistry
Interface providing the capability for handling the
TypedGeneratorRegistry
programmatically. Implementors of this
interface, usually the base test-classes, are supposed to take care about the
runtime handling of the TypedGeneratorRegistry
The runtime handling
consists of three steps
- Initialize
TypedGeneratorRegistry
with the basic Java-types, by callingTypedGeneratorRegistry.registerBasicTypes()
usually called before all tests. - Pick up all additional configured
TypedGenerator
and register them to theTypedGeneratorRegistry
, see Configuration - Tear down / clear
TypedGeneratorRegistry
by callingTypedGeneratorRegistry.clear()
using called in the context after all tests.
Configuration
PropertyMetadata
: The actual property values are generated usingTypedGenerator
s, seePropertyConfig.generator()
. They can be tweaked in multiple ways, seede.cuioss.test.valueobjects.api.generator
for details- In case the actual test-class implements
TypedGenerator
itself it will implicitly registered asTypedGenerator
atTypedGeneratorRegistry
- In cases you can not use the
PropertyGenerator
annotation, e.g. if you have instances ofTypedGenerator
but not types you can overrideregisterAdditionalGenerators()
.
- Author:
- Oliver Wolff
-
Method Summary
Modifier and TypeMethodDescriptiondefault List<de.cuioss.test.generator.TypedGenerator<?>>
Callback method for registering additional generator, in cases you can not use thePropertyGenerator
annotation, e.g.
-
Method Details
-
registerAdditionalGenerators
Callback method for registering additional generator, in cases you can not use thePropertyGenerator
annotation, e.g. if you have instances ofTypedGenerator
but not types. The default implementation solely return a mutable emptyList
, must therefore not be considered using super- Returns:
- A list of
TypedGenerator
s to be registered
-