use of ddf.catalog.plugin.PostIngestPlugin in project ddf by codice.
the class CatalogFrameworkQueryTest method initFramework.
@Before
public void initFramework() {
MockMemoryProvider provider = new MockMemoryProvider("Provider", "Provider", "v1.0", "DDF", new HashSet<ContentType>(), true, new Date());
final SourcePoller<SourceStatus> mockStatusSourcePoller = mock(SourcePoller.class);
when(mockStatusSourcePoller.getCachedValueForSource(isA(Source.class))).thenReturn(Optional.of(SourceStatus.AVAILABLE));
ArrayList<PostIngestPlugin> postIngestPlugins = new ArrayList<>();
FrameworkProperties props = new FrameworkProperties();
props.setCatalogProviders(Collections.singletonList(provider));
props.setPostIngest(postIngestPlugins);
props.setFederationStrategy(new MockFederationStrategy());
props.setQueryResponsePostProcessor(mock(QueryResponsePostProcessor.class));
props.setFilterBuilder(new GeotoolsFilterBuilder());
props.setDefaultAttributeValueRegistry(new DefaultAttributeValueRegistryImpl());
UuidGenerator uuidGenerator = mock(UuidGenerator.class);
when(uuidGenerator.generateUuid()).thenReturn(UUID.randomUUID().toString());
ActionRegistry sourceActionRegistry = mock(ActionRegistry.class);
when(sourceActionRegistry.list(any())).thenReturn(Collections.emptyList());
OperationsSecuritySupport opsSecurity = new OperationsSecuritySupport();
MetacardFactory metacardFactory = new MetacardFactory(props.getMimeTypeToTransformerMapper(), uuidGenerator);
OperationsMetacardSupport opsMetacard = new OperationsMetacardSupport(props, metacardFactory);
SourceOperations sourceOperations = new SourceOperations(props, sourceActionRegistry, mockStatusSourcePoller, mock(SourcePoller.class));
QueryOperations queryOperations = new QueryOperations(props, sourceOperations, opsSecurity, opsMetacard);
ResourceOperations resourceOperations = new ResourceOperations(props, queryOperations, opsSecurity);
TransformOperations transformOperations = new TransformOperations(props);
OperationsCatalogStoreSupport opsCatStore = new OperationsCatalogStoreSupport(props, sourceOperations);
OperationsStorageSupport opsStorage = new OperationsStorageSupport(sourceOperations, queryOperations);
CreateOperations createOperations = new CreateOperations(props, queryOperations, sourceOperations, opsSecurity, opsMetacard, opsCatStore, opsStorage);
UpdateOperations updateOperations = new UpdateOperations(props, queryOperations, sourceOperations, opsSecurity, opsMetacard, opsCatStore, opsStorage);
DeleteOperations deleteOperations = new DeleteOperations(props, queryOperations, sourceOperations, opsSecurity, opsMetacard);
Historian historian = new Historian();
historian.setHistoryEnabled(false);
updateOperations.setHistorian(historian);
deleteOperations.setHistorian(historian);
framework = new CatalogFrameworkImpl(createOperations, updateOperations, deleteOperations, queryOperations, resourceOperations, sourceOperations, transformOperations);
sourceOperations.bind(provider);
}
Aggregations