use of datawave.webservice.result.QueryImplListResponse in project datawave by NationalSecurityAgency.
the class ExtendedQueryExecutorBeanTest method testListUserQueries_HappyPath.
@Test
public void testListUserQueries_HappyPath() throws Exception {
// Set expectations
expect(this.persister.findByUser()).andReturn(Arrays.asList(this.query));
// Run the test
PowerMock.replayAll();
QueryExecutorBean subject = new QueryExecutorBean();
setInternalState(subject, Persister.class, persister);
setInternalState(subject, QueryMetricFactory.class, new QueryMetricFactoryImpl());
QueryImplListResponse result1 = subject.listUserQueries();
subject.close();
PowerMock.verifyAll();
// Verify results
assertNotNull("Query response should not be returned null", result1);
}
use of datawave.webservice.result.QueryImplListResponse in project datawave by NationalSecurityAgency.
the class ExtendedQueryExecutorBeanTest method testListQueriesForUser_HappyPath.
@Test
public void testListQueriesForUser_HappyPath() throws Exception {
// Set local test input
String userSid = "userSid";
// Set expectations
expect(this.persister.findByUser(userSid)).andReturn(Arrays.asList(this.query));
// Run the test
PowerMock.replayAll();
QueryExecutorBean subject = new QueryExecutorBean();
setInternalState(subject, Persister.class, persister);
setInternalState(subject, QueryMetricFactory.class, new QueryMetricFactoryImpl());
QueryImplListResponse result1 = subject.listQueriesForUser(userSid);
PowerMock.verifyAll();
// Verify results
assertNotNull("Expected a non-null response", result1);
}
Aggregations