Ref enhancements
big-andy-coates opened this issue · 0 comments
big-andy-coates commented
TestSuiteDef
contains a list of Ref
erences 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:
TemplateRef
is a subtype ofRef
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).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 theInjectableRef
to be augment the data within the input/expectation file during deserialisation.