Search in sources :

Example 21 with SplunkEvent

use of org.apache.camel.component.splunk.event.SplunkEvent in project camel by apache.

the class ProducerTest method testSubmitWriter.

@Test
public void testSubmitWriter() throws Exception {
    MockEndpoint mock = getMockEndpoint("mock:submitresult");
    mock.setExpectedMessageCount(1);
    SplunkEvent splunkEvent = new SplunkEvent();
    splunkEvent.addPair("key1", "value1");
    splunkEvent.addPair("key2", "value2");
    splunkEvent.addPair("key3", "value1");
    template.sendBody("direct:submit", splunkEvent);
    assertMockEndpointsSatisfied();
    Producer submitProducer = submitEndpoint.createProducer();
    assertIsInstanceOf(SubmitDataWriter.class, ((SplunkProducer) submitProducer).getDataWriter());
}
Also used : SplunkEvent(org.apache.camel.component.splunk.event.SplunkEvent) Producer(org.apache.camel.Producer) MockEndpoint(org.apache.camel.component.mock.MockEndpoint) Test(org.junit.Test)

Aggregations

SplunkEvent (org.apache.camel.component.splunk.event.SplunkEvent)21 Test (org.junit.Test)13 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)11 JobArgs (com.splunk.JobArgs)4 Job (com.splunk.Job)3 JobResultsArgs (com.splunk.JobResultsArgs)3 InputStream (java.io.InputStream)3 Calendar (java.util.Calendar)3 Producer (org.apache.camel.Producer)3 JobCollection (com.splunk.JobCollection)2 Exchange (org.apache.camel.Exchange)2 Message (org.apache.camel.Message)2 Matchers.anyString (org.mockito.Matchers.anyString)2 ResultsReader (com.splunk.ResultsReader)1 ResultsReaderJson (com.splunk.ResultsReaderJson)1 SavedSearch (com.splunk.SavedSearch)1 SavedSearchCollection (com.splunk.SavedSearchCollection)1 SavedSearchDispatchArgs (com.splunk.SavedSearchDispatchArgs)1 Service (com.splunk.Service)1 ServiceArgs (com.splunk.ServiceArgs)1