Search in sources :

Example 1 with OptionPreset

use of com.github.victools.jsonschema.generator.OptionPreset in project jsonschema-generator by victools.

the class EnumModuleTest method initConfigBuilder.

/**
 * Initialise configuration builder instance for the given JSON Schema version.
 *
 * @param schemaVersion designated JSON Schema version
 */
private void initConfigBuilder(SchemaVersion schemaVersion) {
    this.prepareContextForVersion(schemaVersion);
    SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(schemaVersion, new OptionPreset());
    this.typeConfigPart = Mockito.spy(configBuilder.forTypesInGeneral());
    this.fieldConfigPart = Mockito.spy(configBuilder.forFields());
    this.methodConfigPart = Mockito.spy(configBuilder.forMethods());
    this.builder = Mockito.spy(configBuilder);
    Mockito.when(this.builder.forTypesInGeneral()).thenReturn(this.typeConfigPart);
    Mockito.when(this.builder.forFields()).thenReturn(this.fieldConfigPart);
    Mockito.when(this.builder.forMethods()).thenReturn(this.methodConfigPart);
}
Also used : SchemaGeneratorConfigBuilder(com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder) OptionPreset(com.github.victools.jsonschema.generator.OptionPreset)

Aggregations

OptionPreset (com.github.victools.jsonschema.generator.OptionPreset)1 SchemaGeneratorConfigBuilder (com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder)1