use of ddf.catalog.data.impl.MetacardImpl in project ddf by codice.
the class TestRegistryStore method testUpdateNonRegistryMetacard.
@Test(expected = IngestException.class)
public void testUpdateNonRegistryMetacard() throws Exception {
MetacardImpl updatedMcard = getDefaultMetacard();
updatedMcard.setAttribute(RegistryObjectMetacardType.REGISTRY_ID, null);
UpdateRequestImpl request = new UpdateRequestImpl("testId", updatedMcard);
registryStore.update(request);
}
use of ddf.catalog.data.impl.MetacardImpl in project ddf by codice.
the class TestRegistryUtility method setup.
@Before
public void setup() {
metacard = new MetacardImpl();
tags.add(RegistryConstants.REGISTRY_TAG);
tagsAttribute = new AttributeImpl(Metacard.TAGS, tags);
metacard.setAttribute(tagsAttribute);
}
use of ddf.catalog.data.impl.MetacardImpl in project ddf by codice.
the class ResourceOperationsOptionsTest method setUpResourceOperationsAndMocks.
private void setUpResourceOperationsAndMocks() throws URISyntaxException {
queryOperationsMock = mock(QueryOperations.class);
queryResponseMock = mock(QueryResponse.class);
resultMock = mock(Result.class);
metacard = new MetacardImpl();
metacard.setId("Bobbert");
metacard.setTitle("Bobbert's Title");
mockResultList = new ArrayList<>();
resourceOperations = new ResourceOperations(frameworkProperties, queryOperationsMock, null);
when(queryResponseMock.getResults()).thenReturn(mockResultList);
when(resultMock.getMetacard()).thenReturn(metacard);
}
use of ddf.catalog.data.impl.MetacardImpl in project ddf by codice.
the class RemoteDeleteOperationsTest method setUpMocks.
private void setUpMocks() throws IOException, CatalogTransformerException {
String localProviderName = "ddf";
mockPoller = mock(SourcePoller.class);
when(mockPoller.getCachedSource(isA(Source.class))).thenReturn(null);
provider = mock(CatalogProvider.class);
when(provider.getId()).thenReturn(localProviderName);
when(provider.isAvailable(isA(SourceMonitor.class))).thenReturn(true);
when(provider.isAvailable()).thenReturn(true);
mockPostResourcePlugin = mock(PostResourcePlugin.class);
mockPostResourcePlugins = new ArrayList<PostResourcePlugin>();
mockPostResourcePlugins.add(mockPostResourcePlugin);
mockFederationStrategy = mock(FederationStrategy.class);
postIngestPlugins = new ArrayList<>();
storageProvider = new MockMemoryStorageProvider();
mimeTypeResolver = mock(MimeTypeResolver.class);
mimeTypeToTransformerMapper = mock(MimeTypeToTransformerMapper.class);
uuidGenerator = mock(UuidGenerator.class);
when(uuidGenerator.generateUuid()).thenReturn(UUID.randomUUID().toString());
inputTransformer = mock(InputTransformer.class);
when(inputTransformer.transform(any(InputStream.class))).thenReturn(new MetacardImpl());
when(mimeTypeToTransformerMapper.findMatches(any(Class.class), any(MimeType.class))).thenReturn(Collections.singletonList(inputTransformer));
}
use of ddf.catalog.data.impl.MetacardImpl in project ddf by codice.
the class RemoteDeleteOperationsTest method setUpDeleteRequest.
private void setUpDeleteRequest() {
MetacardImpl metacard = new MetacardImpl();
ArrayList<Metacard> metacardList = new ArrayList<>();
metacard.setId("Bob");
metacard.setTitle("Bob's Title");
metacardList.add(metacard);
metacard = new MetacardImpl();
metacard.setId("Bobbert");
metacard.setTitle("Bobbert's Title");
metacardList.add(metacard);
deleteRequest = new DeleteRequestImpl(metacard.getId());
deleteResponse = new DeleteResponseImpl(deleteRequest, new HashMap(), metacardList);
}
Aggregations