Class CustomValueProviderParser

java.lang.Object
de.floydkretschmar.fixturize.CustomValueProviderParser

public class CustomValueProviderParser extends Object
Creates value providers from string definitions using the nashorn script engine.
  • Constructor Details

    • CustomValueProviderParser

      public CustomValueProviderParser()
  • Method Details

    • parseValueProvider

      public static ValueProvider parseValueProvider(String valueProviderDefinition)
      Returns a valid ValueProvider for a provided string representation defining a custom ValueProvider. 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