Search in sources :

Example 11 with SchemaStore

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

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

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