@Test
public void onEvent() throws Exception {

    // Create mocks
    SiddhiPlan siddhiPlanMock = mock(SiddhiPlan.class);
    when(siddhiPlanMock.getId()).thenReturn("testMockID");
    when(siddhiPlanMock.getInput()).thenReturn(Collections.singletonList("test"));
    // Create the handler and add the execution plan mock
    SiddhiHandler siddhiHandler = new SiddhiHandler();
    siddhiHandler.add(siddhiPlanMock);
    // Create the event map
    Map<String, Object> dataMap = new HashMap<>();
    dataMap.put("a", "testa");
    dataMap.put("b", "testb");
    dataMap.put("c", "testc");
    dataMap.put("d", 128);
    dataMap.put("e", 10);
    MapEvent mapEventStub = new MapEvent();
    mapEventStub.setData(dataMap);
    mapEventStub.setSource("test");
    // Send the event
    siddhiHandler.onEvent(mapEventStub, 1, true);
    // Checks if send was called
    verify(siddhiPlanMock).send("test", dataMap);
}