@Test
public void testRegisterMultipleEvents_shouldOnlyProcessOneEvent() throws Exception {
CountDownLatch latch = new CountDownLatch(1);
trackInvocations((DummyExampleDomain) domains.get("example"), latch).doSomething("it works");
RemoteEvent reg = new RemoteEvent(TestEvent.class.getName());
regService.registerEvent(reg, "testPort", "test://localhost", "workflowService");
RemoteEvent reg2 = new RemoteEvent(TestEvent.class.getName());
Map<String, String> nestedEventProperties = new HashMap<String, String>();
nestedEventProperties.put("value", "testValue");
reg2.setNestedEventProperties(nestedEventProperties);
regService.registerEvent(reg2, "testPort", "test://localhost", "workflowService");
String ruleCode = "when RemoteEvent() then example.doSomething(\"it works\");";
manager.add(new RuleBaseElementId(RuleBaseElementType.Rule, "react to remote-event"), ruleCode);
service.processEvent(new TestEvent());