use of io.spine.server.command.TestEventFactory in project core-java by SpineEventEngine.
the class EventEnricherShould method createEvent.
private static Event createEvent(Message msg) {
final TestEventFactory eventFactory = newInstance(EventEnricherShould.class);
final Event event = eventFactory.createEvent(msg);
return event;
}
use of io.spine.server.command.TestEventFactory in project core-java by SpineEventEngine.
the class IntegrationBusTestEnv method projectStarted.
public static Event projectStarted() {
final ProjectId projectId = projectId();
final TestEventFactory eventFactory = newInstance(pack(projectId), IntegrationBusTestEnv.class);
return eventFactory.createEvent(ItgProjectStarted.newBuilder().setProjectId(projectId).build());
}
use of io.spine.server.command.TestEventFactory in project core-java by SpineEventEngine.
the class ProjectionRepositoryShould method checkDispatchesEvent.
private void checkDispatchesEvent(Message eventMessage) {
final TestEventFactory eventFactory = newEventFactory(tenantId(), PRODUCER_ID);
final Event event = eventFactory.createEvent(eventMessage);
keepTenantIdFromEvent(boundedContext, event);
repository().dispatch(EventEnvelope.of(event));
assertTrue(TestProjection.processed(eventMessage));
}
use of io.spine.server.command.TestEventFactory in project core-java by SpineEventEngine.
the class ProjectionEventDeliveryTestEnv method projectCreated.
public static Event projectCreated() {
final ProjectId projectId = projectId();
final TestEventFactory eventFactory = TestEventFactory.newInstance(pack(projectId), ProjectionEventDeliveryTestEnv.class);
final PrjProjectCreated msg = PrjProjectCreated.newBuilder().setProjectId(projectId).build();
final Event result = eventFactory.createEvent(msg);
return result;
}
use of io.spine.server.command.TestEventFactory in project core-java by SpineEventEngine.
the class DelegatingEventDispatcherShould method delegate_onError.
@Test
public void delegate_onError() {
final TestEventFactory factory = TestEventFactory.newInstance(getClass());
final EventEnvelope envelope = EventEnvelope.of(factory.createEvent(newUuidValue()));
final RuntimeException exception = new RuntimeException("test delegating onError");
delegatingDispatcher.onError(envelope, exception);
assertTrue(delegate.onErrorCalled());
assertEquals(exception, delegate.getLastException());
}
Aggregations