Search in sources :

Example 66 with PolicyResponse

use of ddf.catalog.plugin.PolicyResponse in project ddf by codice.

the class PointOfContactPolicyPluginTest method processPostQueryDoesNothing.

@Test
public void processPostQueryDoesNothing() throws java.lang.Exception {
    PolicyResponse response = pointOfContactPolicyPlugin.processPostQuery(new ResultImpl(), Collections.emptyMap());
    responseIsEmpty(response);
}
Also used : ResultImpl(ddf.catalog.data.impl.ResultImpl) PolicyResponse(ddf.catalog.plugin.PolicyResponse) Test(org.junit.Test)

Example 67 with PolicyResponse

use of ddf.catalog.plugin.PolicyResponse in project ddf by codice.

the class PointOfContactPolicyPluginTest method processPreUpdateDoesNothingWithNoPreviousMetacard.

@Test
public void processPreUpdateDoesNothingWithNoPreviousMetacard() throws java.lang.Exception {
    when(mockOperationTransaction.getPreviousStateMetacards()).thenReturn(Collections.emptyList());
    Map<String, Serializable> inputProperties = new HashMap<String, Serializable>();
    inputProperties.put(OPERATION_TRANSACTION_KEY, mockOperationTransaction);
    PolicyResponse response = pointOfContactPolicyPlugin.processPreUpdate(new MetacardImpl(), inputProperties);
    responseIsEmpty(response);
}
Also used : Serializable(java.io.Serializable) HashMap(java.util.HashMap) PolicyResponse(ddf.catalog.plugin.PolicyResponse) MetacardImpl(ddf.catalog.data.impl.MetacardImpl) Test(org.junit.Test)

Example 68 with PolicyResponse

use of ddf.catalog.plugin.PolicyResponse in project ddf by codice.

the class PointOfContactPolicyPluginTest method processPreUpdateDoesNothingWhenPointOfContactsAreSame.

@Test
public void processPreUpdateDoesNothingWhenPointOfContactsAreSame() throws java.lang.Exception {
    MetacardImpl metacard = getMetacardWithPointOfContact(TEST_POINT_OF_CONTACT);
    PolicyResponse response = pointOfContactPolicyPlugin.processPreUpdate(metacard, setupAndGetInputProperties(metacard));
    responseIsEmpty(response);
}
Also used : PolicyResponse(ddf.catalog.plugin.PolicyResponse) MetacardImpl(ddf.catalog.data.impl.MetacardImpl) Test(org.junit.Test)

Example 69 with PolicyResponse

use of ddf.catalog.plugin.PolicyResponse in project ddf by codice.

the class PointOfContactPolicyPluginTest method processPreCreateDoesNothing.

@Test
public void processPreCreateDoesNothing() throws java.lang.Exception {
    PolicyResponse response = pointOfContactPolicyPlugin.processPreCreate(new MetacardImpl(), Collections.emptyMap());
    responseIsEmpty(response);
}
Also used : PolicyResponse(ddf.catalog.plugin.PolicyResponse) MetacardImpl(ddf.catalog.data.impl.MetacardImpl) Test(org.junit.Test)

Example 70 with PolicyResponse

use of ddf.catalog.plugin.PolicyResponse in project ddf by codice.

the class PointOfContactPolicyPluginTest method processPreUpdateDoesNothingWithWorkspaceMetacard.

@Test
public void processPreUpdateDoesNothingWithWorkspaceMetacard() throws java.lang.Exception {
    Set<String> setOfTags = getSetWithGivenTag("workspace");
    MetacardImpl oldMetacard = getMetacardWithPointOfContact("edited-" + TEST_POINT_OF_CONTACT);
    oldMetacard.setTags(setOfTags);
    MetacardImpl newMetacard = getMetacardWithPointOfContact(TEST_POINT_OF_CONTACT);
    newMetacard.setTags(setOfTags);
    PolicyResponse response = pointOfContactPolicyPlugin.processPreUpdate(newMetacard, setupAndGetInputProperties(oldMetacard));
    responseIsEmpty(response);
}
Also used : PolicyResponse(ddf.catalog.plugin.PolicyResponse) MetacardImpl(ddf.catalog.data.impl.MetacardImpl) Test(org.junit.Test)

Aggregations

PolicyResponse (ddf.catalog.plugin.PolicyResponse)75 Test (org.junit.Test)64 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)20 Metacard (ddf.catalog.data.Metacard)19 AttributeImpl (ddf.catalog.data.impl.AttributeImpl)14 Serializable (java.io.Serializable)14 Set (java.util.Set)14 Result (ddf.catalog.data.Result)13 HashMap (java.util.HashMap)12 PolicyPlugin (ddf.catalog.plugin.PolicyPlugin)10 HashSet (java.util.HashSet)7 ResultImpl (ddf.catalog.data.impl.ResultImpl)6 ResourceResponse (ddf.catalog.operation.ResourceResponse)6 Query (ddf.catalog.operation.Query)5 StopProcessingException (ddf.catalog.plugin.StopProcessingException)4 ImmutableSet (com.google.common.collect.ImmutableSet)3 ResourceRequest (ddf.catalog.operation.ResourceRequest)3 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 OPERATION_TRANSACTION_KEY (ddf.catalog.Constants.OPERATION_TRANSACTION_KEY)2