Search in sources :

Example 1 with CacheProvider

use of org.hisp.dhis.cache.CacheProvider in project dhis2-core by dhis2.

the class SchedulingManagerTest method setUp.

@BeforeEach
void setUp() {
    when(applicationContext.getBeansOfType(any())).thenReturn(Collections.singletonMap("test", job));
    CacheProvider cacheProvider = mock(CacheProvider.class);
    when(cacheProvider.createJobCancelRequestedCache()).thenReturn(new TestCache<>());
    when(cacheProvider.createRunningJobsInfoCache()).thenReturn(new TestCache<>());
    when(cacheProvider.createCompletedJobsInfoCache()).thenReturn(new TestCache<>());
    schedulingManager = new DefaultSchedulingManager(new DefaultJobService(applicationContext), jobConfigurationService, mock(MessageService.class), mock(Notifier.class), mock(LeaderManager.class), taskScheduler, mock(AsyncTaskExecutor.class), cacheProvider);
}
Also used : CacheProvider(org.hisp.dhis.cache.CacheProvider) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with CacheProvider

use of org.hisp.dhis.cache.CacheProvider 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();
}
Also used : NodeTransformer(org.hisp.dhis.node.NodeTransformer) PluckNodeTransformer(org.hisp.dhis.node.transformers.PluckNodeTransformer) DefaultSchemaService(org.hisp.dhis.schema.DefaultSchemaService) SchemaService(org.hisp.dhis.schema.SchemaService) PluckNodeTransformer(org.hisp.dhis.node.transformers.PluckNodeTransformer) DefaultSchemaService(org.hisp.dhis.schema.DefaultSchemaService) CacheProvider(org.hisp.dhis.cache.CacheProvider) JacksonPropertyIntrospector(org.hisp.dhis.schema.introspection.JacksonPropertyIntrospector) HashSet(java.util.HashSet) DefaultPropertyIntrospectorService(org.hisp.dhis.schema.DefaultPropertyIntrospectorService) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

CacheProvider (org.hisp.dhis.cache.CacheProvider)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 HashSet (java.util.HashSet)1 NodeTransformer (org.hisp.dhis.node.NodeTransformer)1 PluckNodeTransformer (org.hisp.dhis.node.transformers.PluckNodeTransformer)1 DefaultPropertyIntrospectorService (org.hisp.dhis.schema.DefaultPropertyIntrospectorService)1 DefaultSchemaService (org.hisp.dhis.schema.DefaultSchemaService)1 SchemaService (org.hisp.dhis.schema.SchemaService)1 JacksonPropertyIntrospector (org.hisp.dhis.schema.introspection.JacksonPropertyIntrospector)1