use of org.apache.camel.component.splunk.event.SplunkEvent in project camel by apache.
the class NormalSearchTest method testSearch.
@Test
public void testSearch() throws Exception {
MockEndpoint searchMock = getMockEndpoint("mock:search-result");
searchMock.expectedMessageCount(1);
getMockEndpoint("mock:submit-result").expectedMessageCount(1);
assertMockEndpointsSatisfied(20, TimeUnit.SECONDS);
SplunkEvent recieved = searchMock.getReceivedExchanges().get(0).getIn().getBody(SplunkEvent.class);
assertNotNull(recieved);
Map<String, String> data = recieved.getEventData();
assertEquals("value1", data.get("key1"));
assertEquals("value2", data.get("key2"));
assertEquals("value3", data.get("key3"));
}
use of org.apache.camel.component.splunk.event.SplunkEvent in project camel by apache.
the class SavedSearchTest method testSavedSearch.
// before run there should be created a saved search 'junit' in splunk
@Test
public void testSavedSearch() throws Exception {
MockEndpoint searchMock = getMockEndpoint("mock:search-saved");
searchMock.expectedMessageCount(1);
assertMockEndpointsSatisfied(20, TimeUnit.SECONDS);
SplunkEvent recieved = searchMock.getReceivedExchanges().get(0).getIn().getBody(SplunkEvent.class);
assertNotNull(recieved);
Map<String, String> data = recieved.getEventData();
assertEquals("value1", data.get("key1"));
assertEquals("value2", data.get("key2"));
assertEquals("value3", data.get("key3"));
}
use of org.apache.camel.component.splunk.event.SplunkEvent in project camel by apache.
the class SplunkProducerTest method testSubmitWriter.
@Test
public void testSubmitWriter() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:submitresult");
mock.expectedMinimumMessageCount(1);
SplunkEvent splunkEvent = new SplunkEvent();
splunkEvent.addPair("key1", "value1");
splunkEvent.addPair("key2", "value2");
splunkEvent.addPair("key3", "value1");
template.sendBody("direct:submit", splunkEvent);
assertMockEndpointsSatisfied();
}
use of org.apache.camel.component.splunk.event.SplunkEvent in project camel by apache.
the class SplunkProducerTest method testStreamWriter.
@Test
public void testStreamWriter() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:stream-result");
mock.expectedMinimumMessageCount(1);
SplunkEvent splunkEvent = new SplunkEvent();
splunkEvent.addPair("key11", "value1");
splunkEvent.addPair("key22", "value2");
splunkEvent.addPair("key33", "value3");
template.sendBody("direct:stream", splunkEvent);
assertMockEndpointsSatisfied();
}
use of org.apache.camel.component.splunk.event.SplunkEvent in project camel by apache.
the class SplunkProducerTest method testTcpWriter.
@Test
public void testTcpWriter() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:tcpresult");
mock.expectedMinimumMessageCount(1);
SplunkEvent splunkEvent = new SplunkEvent();
splunkEvent.addPair("key1", "value1");
splunkEvent.addPair("key2", "value2");
splunkEvent.addPair("key3", "value3");
template.sendBody("direct:tcp", splunkEvent);
assertMockEndpointsSatisfied();
}
Aggregations