use of ddf.catalog.plugin.PolicyResponse in project ddf by codice.
the class MetacardValidityFilterPluginTest method testInvalidMetacards.
@Test
public void testInvalidMetacards() throws Exception {
Result result = mock(Result.class);
PolicyResponse response = filterPluginResponseHelper(result, getErrorsMetacard(), true, false);
assertThat(response.itemPolicy().get("sample").contains("test1"), is(true));
}
use of ddf.catalog.plugin.PolicyResponse in project ddf by codice.
the class MetacardValidityFilterPluginTest method testFilterErrorsOnly.
@Test
public void testFilterErrorsOnly() throws Exception {
Result result = mock(Result.class);
PolicyResponse response = filterPluginResponseHelper(result, getErrorsMetacard(), true, false);
assertThat(response.itemPolicy().get("sample").contains("test1"), is(true));
}
use of ddf.catalog.plugin.PolicyResponse in project ddf by codice.
the class MetacardValidityFilterPluginTest method testFilterNone.
@Test
public void testFilterNone() throws Exception {
Result result = mock(Result.class);
PolicyResponse response = filterPluginResponseHelper(result, getErrorsMetacard(), false, false);
assertThat(response.itemPolicy().size(), is(0));
response = filterPluginResponseHelper(result, getWarningsMetacard(), false, false);
assertThat(response.itemPolicy().size(), is(0));
}
use of ddf.catalog.plugin.PolicyResponse in project ddf by codice.
the class MetacardValidityFilterPluginTest method testNullMetacard.
@Test
public void testNullMetacard() throws Exception {
Result result = mock(Result.class);
PolicyResponse response = filterPluginResponseHelper(result, null, true, false);
assertThat(response.itemPolicy().isEmpty(), is(true));
}
use of ddf.catalog.plugin.PolicyResponse in project ddf by codice.
the class MetacardValidityFilterPluginTest method testNullResults.
@Test
public void testNullResults() throws Exception {
PolicyResponse response = filterPluginResponseHelper(null, getValidMetacard(), true, false);
assertThat(response.itemPolicy().isEmpty(), is(true));
}
Aggregations