trackInvocations((DummyExampleDomain) domains.get("example"), latch).doSomething("it works");
RemoteEvent reg = new RemoteEvent(TestEvent.class.getName());
regService.registerEvent(reg, "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());
assertThat("did not call example.doSomething() after RemoteEvent", latch.await(5, TimeUnit.SECONDS), is(true));
executorService.shutdown();
executorService.awaitTermination(3, TimeUnit.SECONDS);