creek-service/creek-system-test

Ref enhancements

big-andy-coates opened this issue · 0 comments

TestSuiteDef contains a list of References to inputs and expectations. The default SimpleRef type is just the relative path to the input or expectation file within the test package, (with optional file extension).

However, the idea is that is Ref model extendable. I'm thinking two types of Ref extensions:

  1. TemplateRef is a subtype of Ref that can be used to pre-process the file before its converted into its final Java type. The idea here is that the input/expectation file is a template and additional information in the suite can override some of the data in the file. For example, could have an implementation that allowed values within a YAML input or expectation file to be overridden by JSONPath. Another implementation could replace tokens within the file, or even leverage velocity templates or similar. (More thought needed).
  2. InjectableRef is a subtype that can be passed to the @JsonCreator of the Java type an input or expectation is deserialised as. Injection could be achieved via @JacksonInject annotated params in the creator method. This would allow the information in the InjectableRef to be augment the data within the input/expectation file during deserialisation.