Search in sources :

Example 6 with NoopAnnotator

use of org.jsonschema2pojo.NoopAnnotator 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 7 with NoopAnnotator

use of org.jsonschema2pojo.NoopAnnotator 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)

Example 8 with NoopAnnotator

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

the class RuleFactoryImplTest method schemaStoreIsReturned.

@Test
public void schemaStoreIsReturned() {
    SchemaStore mockSchemaStore = mock(SchemaStore.class);
    RuleFactory ruleFactory = new RuleFactory(new DefaultGenerationConfig(), new NoopAnnotator(), mockSchemaStore);
    assertThat(ruleFactory.getSchemaStore(), is(sameInstance(mockSchemaStore)));
}
Also used : DefaultGenerationConfig(org.jsonschema2pojo.DefaultGenerationConfig) SchemaStore(org.jsonschema2pojo.SchemaStore) NoopAnnotator(org.jsonschema2pojo.NoopAnnotator) Test(org.junit.Test)

Example 9 with NoopAnnotator

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

the class RuleFactoryImplTest method generationRuleLoggerIsReturned.

@Test
public void generationRuleLoggerIsReturned() {
    GenerationConfig mockGenerationConfig = mock(GenerationConfig.class);
    RuleLogger mockRuleLogger = mock(RuleLogger.class);
    RuleFactory ruleFactory = new RuleFactory(new DefaultGenerationConfig(), new NoopAnnotator(), new SchemaStore());
    ruleFactory.setLogger(mockRuleLogger);
    assertThat(ruleFactory.getLogger(), is(sameInstance(mockRuleLogger)));
}
Also used : DefaultGenerationConfig(org.jsonschema2pojo.DefaultGenerationConfig) 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

NoopAnnotator (org.jsonschema2pojo.NoopAnnotator)9 SchemaStore (org.jsonschema2pojo.SchemaStore)9 Before (org.junit.Before)6 DefaultGenerationConfig (org.jsonschema2pojo.DefaultGenerationConfig)3 Test (org.junit.Test)3 GenerationConfig (org.jsonschema2pojo.GenerationConfig)2 RuleLogger (org.jsonschema2pojo.RuleLogger)2