use of ddf.catalog.operation.QueryRequest in project ddf by codice.
the class NoOpSolrMetacardClientTest method queryWithRequest.
@Test
public void queryWithRequest() throws Exception {
QueryRequest mockRequest = mock(QueryRequest.class);
SourceResponse response = noOpSolrMetacardClient.query(mockRequest);
assertThat(response.getRequest(), is(mockRequest));
assertThat(response.getResults(), is(empty()));
assertThat(response.getHits(), is(equalTo(0L)));
}
use of ddf.catalog.operation.QueryRequest in project ddf by codice.
the class ValidationQueryFactoryTest method testSearchValid.
@Test
public void testSearchValid() throws StopProcessingException, PluginExecutionException, UnsupportedQueryException {
QueryImpl query = new QueryImpl(filterBuilder.attribute(Validation.VALIDATION_WARNINGS).is().empty());
ValidationQueryDelegate delegate = new ValidationQueryDelegate();
assertThat(filterAdapter.adapt(query, delegate), is(true));
QueryRequest returnQuery = validationQueryFactory.getQueryRequestWithValidationFilter(new QueryRequestImpl(query));
assertThat(filterAdapter.adapt(returnQuery.getQuery(), delegate), is(true));
}
use of ddf.catalog.operation.QueryRequest in project ddf by codice.
the class ValidationQueryFactoryTest method testSearchBothImplicit.
@Test
public void testSearchBothImplicit() throws StopProcessingException, PluginExecutionException, UnsupportedQueryException {
QueryImpl query = new QueryImpl(filterBuilder.allOf(filterBuilder.attribute(Validation.VALIDATION_WARNINGS).is().empty(), filterBuilder.attribute(Validation.VALIDATION_WARNINGS).is().equalTo().text("*")));
QueryRequest returnQuery = validationQueryFactory.getQueryRequestWithValidationFilter(new QueryRequestImpl(query));
assertThat(filterAdapter.adapt(returnQuery.getQuery(), testValidationQueryDelegate), is(true));
}
use of ddf.catalog.operation.QueryRequest in project ddf by codice.
the class ValidationQueryFactoryTest method testSearchBoth.
@Test
public void testSearchBoth() throws StopProcessingException, PluginExecutionException, UnsupportedQueryException {
QueryImpl query = new QueryImpl(filterBuilder.allOf(filterBuilder.attribute(Validation.VALIDATION_WARNINGS).is().empty(), filterBuilder.attribute(Validation.VALIDATION_WARNINGS).is().equalTo().text("sample")));
QueryRequest returnQuery = validationQueryFactory.getQueryRequestWithValidationFilter(new QueryRequestImpl(query));
assertThat(filterAdapter.adapt(returnQuery.getQuery(), testValidationQueryDelegate), is(true));
}
use of ddf.catalog.operation.QueryRequest in project ddf by codice.
the class ValidationQueryFactoryTest method testSearchInvalid.
@Test
public void testSearchInvalid() throws StopProcessingException, PluginExecutionException, UnsupportedQueryException {
QueryImpl query = new QueryImpl(filterBuilder.attribute(Validation.VALIDATION_WARNINGS).is().equalTo().text("sample"));
ValidationQueryDelegate delegate = new ValidationQueryDelegate();
assertThat(filterAdapter.adapt(query, testValidationQueryDelegate), is(true));
QueryRequest returnQuery = validationQueryFactory.getQueryRequestWithValidationFilter(new QueryRequestImpl(query));
assertThat(filterAdapter.adapt(returnQuery.getQuery(), testValidationQueryDelegate), is(true));
}
Aggregations