Search in sources :

Example 1 with TcpInput

use of com.splunk.TcpInput in project camel by apache.

the class MockConnectionSettings method mockSplunkWriterApi.

private void mockSplunkWriterApi() {
    try {
        Index index = mock(Index.class);
        IndexCollection indexColl = mock(IndexCollection.class);
        when(service.getIndexes()).thenReturn(indexColl);
        InputCollection inputCollection = mock(InputCollection.class);
        when(service.getInputs()).thenReturn(inputCollection);
        TcpInput input = mock(TcpInput.class);
        when(input.attach()).thenReturn(socket);
        when(inputCollection.get(anyString())).thenReturn(input);
        when(indexColl.get(anyString())).thenReturn(index);
        when(index.attach(isA(Args.class))).thenReturn(socket);
        when(socket.getOutputStream()).thenReturn(System.out);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : InputCollection(com.splunk.InputCollection) Args(com.splunk.Args) Index(com.splunk.Index) TcpInput(com.splunk.TcpInput) IOException(java.io.IOException) IndexCollection(com.splunk.IndexCollection)

Aggregations

Args (com.splunk.Args)1 Index (com.splunk.Index)1 IndexCollection (com.splunk.IndexCollection)1 InputCollection (com.splunk.InputCollection)1 TcpInput (com.splunk.TcpInput)1 IOException (java.io.IOException)1