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);
}
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();
}
Aggregations