use of org.hisp.dhis.schema.introspection.JacksonPropertyIntrospector in project dhis2-core by dhis2.
the class PluckNodeTransformerTest method setUp.
@BeforeEach
public void setUp() {
schemaService = new DefaultSchemaService(new DefaultPropertyIntrospectorService(new JacksonPropertyIntrospector()), sessionFactory);
collectionNode = new CollectionNode("organisationUnits", 2);
collectionNode.setNamespace("testUrn");
collectionNode.setProperty(schemaService.getDynamicSchema(CategoryOption.class).getProperty("organisationUnits"));
ComplexNode complexNode = new ComplexNode("organisationUnit");
SimpleNode simpleNode = new SimpleNode("id", schemaService.getDynamicSchema(Category.class).getProperty("id"), "abc1");
complexNode.addChild(simpleNode);
simpleNode = new SimpleNode("name", schemaService.getDynamicSchema(Category.class).getProperty("id"), "OU 1");
complexNode.addChild(simpleNode);
collectionNode.addChild(complexNode);
complexNode = new ComplexNode("organisationUnit");
simpleNode = new SimpleNode("id", schemaService.getDynamicSchema(Category.class).getProperty("id"), "abc2");
complexNode.addChild(simpleNode);
simpleNode = new SimpleNode("name", schemaService.getDynamicSchema(Category.class).getProperty("id"), "OU 2");
complexNode.addChild(simpleNode);
collectionNode.addChild(complexNode);
}
use of org.hisp.dhis.schema.introspection.JacksonPropertyIntrospector in project dhis2-core by dhis2.
the class DefaultFieldFilterServiceTest method setUp.
@BeforeEach
public void setUp() {
final Set<NodeTransformer> nodeTransformers = new HashSet<>();
nodeTransformers.add(new PluckNodeTransformer());
final SchemaService schemaService = new DefaultSchemaService(new DefaultPropertyIntrospectorService(new JacksonPropertyIntrospector()), sessionFactory);
CacheProvider cacheProvider = mock(CacheProvider.class);
when(cacheProvider.createPropertyTransformerCache()).thenReturn(new NoOpCache<>());
service = new DefaultFieldFilterService(new DefaultFieldParser(), schemaService, aclService, currentUserService, attributeService, cacheProvider, userGroupService, userService, nodeTransformers);
service.init();
}
Aggregations