Package de.floydkretschmar.fixturize
Class CustomValueProviderParser
java.lang.Object
de.floydkretschmar.fixturize.CustomValueProviderParser
Creates value providers from string definitions using the nashorn script engine.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueProviderparseValueProvider(String valueProviderDefinition) Returns a validValueProviderfor a provided string representation defining a customValueProvider.
-
Constructor Details
-
CustomValueProviderParser
public CustomValueProviderParser()
-
-
Method Details
-
parseValueProvider
Returns a validValueProviderfor a provided string representation defining a customValueProvider. The string representation has to be a single line of code that in the end returns a string, which will in turn be used to create a constant during fixture generation.- Parameters:
valueProviderDefinition- - that defines the value provider function as a string- Returns:
- the parsed
ValueProvider - Throws:
FixtureCreationException- if the provided definition is not a valid line of code
-