Search in sources :

Example 1 with QueryLogicFactory

use of datawave.webservice.query.logic.QueryLogicFactory in project datawave by NationalSecurityAgency.

the class ExtendedQueryExecutorBeanTest method testPurgeQueryCacheAndMiscAccessors_HappyPath.

@Test
public void testPurgeQueryCacheAndMiscAccessors_HappyPath() throws Exception {
    // Set expectations
    this.cache.clear();
    // Run the test
    PowerMock.replayAll();
    QueryExecutorBean subject = new QueryExecutorBean();
    setInternalState(subject, QueryCache.class, cache);
    setInternalState(subject, ClosedQueryCache.class, closedCache);
    setInternalState(subject, QueryMetricFactory.class, new QueryMetricFactoryImpl());
    VoidResponse result1 = subject.purgeQueryCache();
    QueryMetricsBean result5 = subject.getMetrics();
    QueryLogicFactory result6 = subject.getQueryFactory();
    Persister result7 = subject.getPersister();
    QueryCache result8 = subject.getQueryCache();
    PowerMock.verifyAll();
    // Verify results
    assertNotNull("Expected a non-null response", result1);
    assertNull("Expected a null metrics instance", result5);
    assertNull("Expected a null query logic factory", result6);
    assertNull("Expected a null persister", result7);
    assertNotNull("Expected a NON-null cache", result8);
}
Also used : ClosedQueryCache(datawave.webservice.query.cache.ClosedQueryCache) QueryCache(datawave.webservice.query.cache.QueryCache) VoidResponse(datawave.webservice.result.VoidResponse) QueryMetricsBean(datawave.webservice.query.metric.QueryMetricsBean) Persister(datawave.webservice.query.factory.Persister) QueryMetricFactoryImpl(datawave.microservice.querymetric.QueryMetricFactoryImpl) QueryLogicFactory(datawave.webservice.query.logic.QueryLogicFactory) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

QueryMetricFactoryImpl (datawave.microservice.querymetric.QueryMetricFactoryImpl)1 ClosedQueryCache (datawave.webservice.query.cache.ClosedQueryCache)1 QueryCache (datawave.webservice.query.cache.QueryCache)1 Persister (datawave.webservice.query.factory.Persister)1 QueryLogicFactory (datawave.webservice.query.logic.QueryLogicFactory)1 QueryMetricsBean (datawave.webservice.query.metric.QueryMetricsBean)1 VoidResponse (datawave.webservice.result.VoidResponse)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1