ppi-ag / deep-sampler

DeepSampler is a stubbing framework for compound tests
https://ppi.de
MIT License
11 stars 2 forks source link

Allow configuration of another SourceManager using an annotation #93

Closed JanSchankin closed 2 years ago

JanSchankin commented 2 years ago

Currently we can only define another Sourcemanager using the low-level-api as in

PersistentSampler.source(JsonSourceManager.builder().buildWithFile(pathToFile))

This also means, that persistence related annotations cannot be used at all, if another SourceManager must be used. Therefore we need a new annotation that configures the SourceManager.

JanSchankin commented 2 years ago

A SourceManagerFactory now enables users to instanitate and configure custom SourceManagers in a way, that is usable for annotations. It´s now possible to define custom annotations for loading and saving samples from arbitrary sources. This is done using the meta annotations @UseSourceManagerForSaving and @UseSourceManagerForLoading. Both annotations act as a command for loading and saving, but they also bind the new SourceManagerFactory to the persistence-process.