Package com.splunk

Examples of com.splunk.JobCollection


public class ConsumerStreamingTest extends SplunkMockTestSupport {
    @Test
    public void testSearch() throws Exception {
        MockEndpoint searchMock = getMockEndpoint("mock:search-result");
        searchMock.expectedMessageCount(3);
        JobCollection jobCollection = mock(JobCollection.class);
        Job jobMock = mock(Job.class);
        when(service.getJobs()).thenReturn(jobCollection);
        when(jobCollection.create(anyString(), any(JobArgs.class))).thenReturn(jobMock);
        when(jobMock.isDone()).thenReturn(Boolean.TRUE);
        InputStream stream = ConsumerTest.class.getResourceAsStream("/resultsreader_test_data.json");
        when(jobMock.getResults(any(JobResultsArgs.class))).thenReturn(stream);

        assertMockEndpointsSatisfied();
View Full Code Here


    @Test
    public void testSearch() throws Exception {
        MockEndpoint searchMock = getMockEndpoint("mock:search-result");
        searchMock.expectedMessageCount(3);
        searchMock.expectedPropertyReceived(Exchange.BATCH_SIZE, 3);
        JobCollection jobCollection = mock(JobCollection.class);
        Job jobMock = mock(Job.class);
        when(service.getJobs()).thenReturn(jobCollection);
        when(jobCollection.create(anyString(), any(JobArgs.class))).thenReturn(jobMock);
        when(jobMock.isDone()).thenReturn(Boolean.TRUE);
        InputStream stream = ConsumerTest.class.getResourceAsStream("/resultsreader_test_data.json");
        when(jobMock.getResults(any(JobResultsArgs.class))).thenReturn(stream);

        assertMockEndpointsSatisfied();
View Full Code Here

TOP

Related Classes of com.splunk.JobCollection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.