@Test public void onEventWithIncorrectValidation() throws Exception { UntypedRecordableEventDescriptor descriptor = mockDescriptor(); when(descriptor.getValidationExpression()).thenReturn("someVelocityCode"); when(scriptContext.getAttribute("xreturn")).thenReturn(false); mocker.getComponentUnderTest().onEvent(new DocumentUpdatedEvent(), mock(Object.class), null); verify(this.observationManager, never()).notify(any(), any(), any()); assertNull(answer.getSentEvent()); }
@Override public void onEvent(Event event, Object source, Object data) { try { List<UntypedRecordableEventDescriptor> descriptors = this.componentManagerProvider.get().getInstanceList(UntypedRecordableEventDescriptor.class); for (UntypedRecordableEventDescriptor descriptor : descriptors) { if (eventMatchesDescriptor(event, source, descriptor)) { Set<String> target = getTarget(event, source, descriptor.getAuthorReference(), descriptor.getTargetExpression()); observationManager.notify( new DefaultUntypedRecordableEvent(descriptor.getEventType(), target), EVENT_STREAM_MODULE, source); } } } catch (ComponentLookupException e) { logger.error("Unable to retrieve a list of registered UntypedRecordableEventDescriptor " + "from the ComponentManager.", e); } }
UntypedEventListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { try { List<UntypedRecordableEventDescriptor> descriptors = this.componentManagerProvider.get().getInstanceList(UntypedRecordableEventDescriptor.class); for (UntypedRecordableEventDescriptor descriptor : descriptors) { if (eventMatchesDescriptor(event, source, descriptor)) { Set<String> target = getTarget(event, source, descriptor.getAuthorReference(), descriptor.getTargetExpression()); observationManager.notify( new DefaultUntypedRecordableEvent(descriptor.getEventType(), target), EVENT_STREAM_MODULE, source); } } } catch (ComponentLookupException e) { logger.error("Unable to retrieve a list of registered UntypedRecordableEventDescriptor " + "from the ComponentManager.", e); } } }
UntypedEventListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { try { List<UntypedRecordableEventDescriptor> descriptors = this.componentManagerProvider.get().getInstanceList(UntypedRecordableEventDescriptor.class); for (UntypedRecordableEventDescriptor descriptor : descriptors) { if (eventMatchesDescriptor(event, source, descriptor)) { Set<String> target = getTarget(event, source, descriptor.getAuthorReference(), descriptor.getTargetExpression()); observationManager.notify( new DefaultUntypedRecordableEvent(descriptor.getEventType(), target), EVENT_STREAM_MODULE, source); } } } catch (ComponentLookupException e) { logger.error("Unable to retrieve a list of registered UntypedRecordableEventDescriptor " + "from the ComponentManager.", e); } } UntypedEventListener(); }
UntypedEventListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { try { List<UntypedRecordableEventDescriptor> descriptors = this.componentManagerProvider.get().getInstanceList(UntypedRecordableEventDescriptor.class); for (UntypedRecordableEventDescriptor descriptor : descriptors) { if (eventMatchesDescriptor(event, source, descriptor)) { Set<String> target = getTarget(event, source, descriptor.getAuthorReference(), descriptor.getTargetExpression()); observationManager.notify( new DefaultUntypedRecordableEvent(descriptor.getEventType(), target), EVENT_STREAM_MODULE, source); } } } catch (ComponentLookupException e) { logger.error("Unable to retrieve a list of registered UntypedRecordableEventDescriptor " + "from the ComponentManager.", e); } } UntypedEventListener(); @Override void onEvent(Event event, Object source, Object data); }
UntypedEventListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { try { List<UntypedRecordableEventDescriptor> descriptors = this.componentManagerProvider.get().getInstanceList(UntypedRecordableEventDescriptor.class); for (UntypedRecordableEventDescriptor descriptor : descriptors) { if (eventMatchesDescriptor(event, source, descriptor)) { Set<String> target = getTarget(event, source, descriptor.getAuthorReference(), descriptor.getTargetExpression()); observationManager.notify( new DefaultUntypedRecordableEvent(descriptor.getEventType(), target), EVENT_STREAM_MODULE, source); } } } catch (ComponentLookupException e) { logger.error("Unable to retrieve a list of registered UntypedRecordableEventDescriptor " + "from the ComponentManager.", e); } } UntypedEventListener(); @Override void onEvent(Event event, Object source, Object data); static final String NAME; static final String EVENT_BINDING_NAME; static final String SOURCE_BINDING_NAME; }