Search in sources :

Example 26 with CreateResponseImpl

use of ddf.catalog.operation.impl.CreateResponseImpl in project ddf by codice.

the class RegistryIdPostIngestPluginTest method testProcessCreateInternal.

@Test
public void testProcessCreateInternal() throws Exception {
    CreateResponse response = new CreateResponseImpl(null, null, Collections.singletonList(getDefaultInternalMetacard()));
    registryIdPostIngestPlugin.process(response);
    assertThat(registryIdPostIngestPlugin.getRegistryIds().size(), equalTo(0));
    assertThat(registryIdPostIngestPlugin.getRemoteMetacardIds().size(), equalTo(1));
    assertThat(registryIdPostIngestPlugin.getRemoteMetacardIds().iterator().next(), equalTo("remoteMcardId"));
}
Also used : CreateResponse(ddf.catalog.operation.CreateResponse) CreateResponseImpl(ddf.catalog.operation.impl.CreateResponseImpl) Test(org.junit.Test)

Example 27 with CreateResponseImpl

use of ddf.catalog.operation.impl.CreateResponseImpl in project ddf by codice.

the class RegistryIdPostIngestPluginTest method testProcessDeleteInternal.

@Test
public void testProcessDeleteInternal() throws Exception {
    CreateResponse createResponse = new CreateResponseImpl(null, null, Collections.singletonList(getDefaultInternalMetacard()));
    registryIdPostIngestPlugin.process(createResponse);
    DeleteResponse deleteResponse = new DeleteResponseImpl(null, null, Collections.singletonList(getDefaultInternalMetacard()));
    registryIdPostIngestPlugin.process(deleteResponse);
    assertThat(registryIdPostIngestPlugin.getRemoteMetacardIds().size(), equalTo(0));
}
Also used : DeleteResponse(ddf.catalog.operation.DeleteResponse) DeleteResponseImpl(ddf.catalog.operation.impl.DeleteResponseImpl) CreateResponse(ddf.catalog.operation.CreateResponse) CreateResponseImpl(ddf.catalog.operation.impl.CreateResponseImpl) Test(org.junit.Test)

Example 28 with CreateResponseImpl

use of ddf.catalog.operation.impl.CreateResponseImpl in project ddf by codice.

the class RegistryIdPostIngestPluginTest method testProcessCreate.

@Test
public void testProcessCreate() throws Exception {
    CreateResponse response = new CreateResponseImpl(null, null, Collections.singletonList(getDefaultMetacard()));
    registryIdPostIngestPlugin.process(response);
    assertThat(registryIdPostIngestPlugin.getRegistryIds().size(), equalTo(1));
    assertThat(registryIdPostIngestPlugin.getRegistryIds().iterator().next(), equalTo("regId"));
}
Also used : CreateResponse(ddf.catalog.operation.CreateResponse) CreateResponseImpl(ddf.catalog.operation.impl.CreateResponseImpl) Test(org.junit.Test)

Aggregations

CreateResponseImpl (ddf.catalog.operation.impl.CreateResponseImpl)28 CreateResponse (ddf.catalog.operation.CreateResponse)24 Test (org.junit.Test)21 Metacard (ddf.catalog.data.Metacard)17 CreateRequestImpl (ddf.catalog.operation.impl.CreateRequestImpl)16 HashMap (java.util.HashMap)15 CreateRequest (ddf.catalog.operation.CreateRequest)14 ArrayList (java.util.ArrayList)10 Serializable (java.io.Serializable)9 List (java.util.List)7 Subject (ddf.security.Subject)6 Exchange (org.apache.camel.Exchange)6 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)6 IngestException (ddf.catalog.source.IngestException)5 InputStream (java.io.InputStream)5 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)4 DeleteResponse (ddf.catalog.operation.DeleteResponse)4 HashSet (java.util.HashSet)4 DeleteResponseImpl (ddf.catalog.operation.impl.DeleteResponseImpl)3 HttpHeaders (javax.ws.rs.core.HttpHeaders)3