Search in sources :

Example 6 with IntegrationEvent

use of io.spine.server.integration.IntegrationEvent in project core-java by SpineEventEngine.

the class BoundedContextShould method not_notify_integration_event_subscriber_if_event_is_invalid.

@Test
public void not_notify_integration_event_subscriber_if_event_is_invalid() {
    final BoundedContext boundedContext = BoundedContext.newBuilder().setMultitenant(true).build();
    // Unsupported message.
    final Any invalidMsg = AnyPacker.pack(BcProjectCreated.getDefaultInstance());
    final IntegrationEvent event = Given.AnIntegrationEvent.projectCreated().toBuilder().setMessage(invalidMsg).build();
    final MemoizingObserver<Ack> observer = memoizingObserver();
    boundedContext.notify(event, observer);
    assertEquals(ERROR, observer.firstResponse().getStatus().getStatusCase());
}
Also used : Ack(io.spine.core.Ack) IntegrationEvent(io.spine.server.integration.IntegrationEvent) BoundedContext(io.spine.server.BoundedContext) Any(com.google.protobuf.Any) Test(org.junit.Test)

Aggregations

IntegrationEvent (io.spine.server.integration.IntegrationEvent)6 Message (com.google.protobuf.Message)2 Event (io.spine.base.Event)2 Ack (io.spine.core.Ack)2 Event (io.spine.core.Event)2 IntegrationEventContext (io.spine.server.integration.IntegrationEventContext)2 Test (org.junit.Test)2 Any (com.google.protobuf.Any)1 Experimental (io.spine.annotation.Experimental)1 EventContext (io.spine.base.EventContext)1 EventContext (io.spine.core.EventContext)1 BoundedContext (io.spine.server.BoundedContext)1