Search in sources :

Example 6 with SchemaStore

use of org.jsonschema2pojo.SchemaStore in project jsonschema2pojo by joelittlejohn.

the class FormatRuleJodaTest method setupConfig.

@Before
public void setupConfig() {
    when(config.isUseJodaLocalTimes()).thenReturn(true);
    when(config.isUseJodaLocalDates()).thenReturn(true);
    when(config.isUseJodaDates()).thenReturn(true);
    rule = new FormatRule(new RuleFactory(config, new NoopAnnotator(), new SchemaStore()));
}
Also used : SchemaStore(org.jsonschema2pojo.SchemaStore) NoopAnnotator(org.jsonschema2pojo.NoopAnnotator) Before(org.junit.Before)

Example 7 with SchemaStore

use of org.jsonschema2pojo.SchemaStore in project jsonschema2pojo by joelittlejohn.

the class DigitsRuleTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    rule = new DigitsRule(new RuleFactory(config, new NoopAnnotator(), new SchemaStore()));
    when(config.isUseJakartaValidation()).thenReturn(useJakartaValidation);
}
Also used : SchemaStore(org.jsonschema2pojo.SchemaStore) NoopAnnotator(org.jsonschema2pojo.NoopAnnotator) Before(org.junit.Before)

Example 8 with SchemaStore

use of org.jsonschema2pojo.SchemaStore in project jsonschema2pojo by joelittlejohn.

the class MinItemsMaxItemsRuleTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    rule = new MinItemsMaxItemsRule(new RuleFactory(config, new NoopAnnotator(), new SchemaStore()));
    when(config.isUseJakartaValidation()).thenReturn(useJakartaValidation);
}
Also used : SchemaStore(org.jsonschema2pojo.SchemaStore) NoopAnnotator(org.jsonschema2pojo.NoopAnnotator) Before(org.junit.Before)

Example 9 with SchemaStore

use of org.jsonschema2pojo.SchemaStore in project jsonschema2pojo by joelittlejohn.

the class MinimumMaximumRuleTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    rule = new MinimumMaximumRule(new RuleFactory(config, new NoopAnnotator(), new SchemaStore()));
    when(config.isUseJakartaValidation()).thenReturn(useJakartaValidation);
}
Also used : SchemaStore(org.jsonschema2pojo.SchemaStore) NoopAnnotator(org.jsonschema2pojo.NoopAnnotator) Before(org.junit.Before)

Example 10 with SchemaStore

use of org.jsonschema2pojo.SchemaStore in project jsonschema2pojo by joelittlejohn.

the class RuleFactoryImplTest method generationConfigIsReturned.

@Test
public void generationConfigIsReturned() {
    GenerationConfig mockGenerationConfig = mock(GenerationConfig.class);
    RuleLogger mockRuleLogger = mock(RuleLogger.class);
    RuleFactory ruleFactory = new RuleFactory(mockGenerationConfig, new NoopAnnotator(), new SchemaStore());
    ruleFactory.setLogger(mockRuleLogger);
    assertThat(ruleFactory.getGenerationConfig(), is(sameInstance(mockGenerationConfig)));
    assertThat(ruleFactory.getLogger(), is(sameInstance(mockRuleLogger)));
}
Also used : RuleLogger(org.jsonschema2pojo.RuleLogger) SchemaStore(org.jsonschema2pojo.SchemaStore) NoopAnnotator(org.jsonschema2pojo.NoopAnnotator) GenerationConfig(org.jsonschema2pojo.GenerationConfig) DefaultGenerationConfig(org.jsonschema2pojo.DefaultGenerationConfig) Test(org.junit.Test)

Aggregations

SchemaStore (org.jsonschema2pojo.SchemaStore)12 NoopAnnotator (org.jsonschema2pojo.NoopAnnotator)9 Before (org.junit.Before)6 GenerationConfig (org.jsonschema2pojo.GenerationConfig)5 Test (org.junit.Test)5 DefaultGenerationConfig (org.jsonschema2pojo.DefaultGenerationConfig)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 JCodeModel (com.sun.codemodel.JCodeModel)2 URI (java.net.URI)2 RuleLogger (org.jsonschema2pojo.RuleLogger)2 Schema (org.jsonschema2pojo.Schema)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 JDefinedClass (com.sun.codemodel.JDefinedClass)1 JType (com.sun.codemodel.JType)1 URL (java.net.URL)1 Jackson2Annotator (org.jsonschema2pojo.Jackson2Annotator)1 SchemaGenerator (org.jsonschema2pojo.SchemaGenerator)1 SchemaMapper (org.jsonschema2pojo.SchemaMapper)1 RuleFactory (org.jsonschema2pojo.rules.RuleFactory)1