Package de.ppi.deepsampler.junit.json
Annotation Type LoadSamples
@Retention(RUNTIME)
@Target(METHOD)
public @interface LoadSamples
The @
LoadSamples-annotation may be used at any test method as a convenient way to load Samples from a
JSON-file. The JSON-file is usually created using @SaveSamples.
It is possible to load the file either from a local filesystem or from the classpath (property source())
The filename may be defined using the property value(). The default filename is composed using the
full qualified name of the test class and the test method.
This annotation must be used in combination with @UseSamplerFixture.
It is possible to register some extensions to customize the deserialization using the annotations @UseJsonDeserializer
and @UseBeanConverterExtension.
-
Optional Element Summary
-
Element Details
-
value
java.lang.String valueThe name of the json file. If this property is omitted, the name will be composed like so: [package of the test class]/[Test class name]_[test method].jsonThe root path of relative filenames for source
FileSource.FILE_SYSTEMis by default './'. It can be changed, using the annotationSampleRootPath.FileSource.CLASSPATHis the classpath itself. value() will be interpreted exactly as it is described byClassLoader.getResource(String). Since the ClassLoader is retrieved from the current test class, value() can also be defined relative to the test class. The annotationSampleRootPathis ignored.
*
- Returns:
- the name of the sample JSON file.
- Default:
- "`v\u00b0\u00b0v\u00b4$de.ppi.deepsampler.junit.AnnotationConstants$$$DefaultValueMustBeCalculated$"
-
source
de.ppi.deepsampler.junit.FileSource sourceDefines from where the file is loaded. Either the classpath or the vanilla filesystem can be used. Default isFileSource.FILE_SYSTEM.- Returns:
- The source of the file.
- Default:
- FILE_SYSTEM
-