Search in sources :

Example 16 with EventContext

use of io.spine.core.EventContext in project core-java by SpineEventEngine.

the class TestEventFactory method createEvent.

/**
 * Creates an event produced at the passed time.
 */
public Event createEvent(Message messageOrAny, @Nullable Version version, Timestamp atTime) {
    final Event event = createEvent(messageOrAny, version);
    final EventContext context = event.getContext().toBuilder().setTimestamp(atTime).build();
    final Event result = event.toBuilder().setContext(context).build();
    return result;
}
Also used : EventContext(io.spine.core.EventContext) Event(io.spine.core.Event)

Aggregations

EventContext (io.spine.core.EventContext)16 Event (io.spine.core.Event)12 Test (org.junit.Test)6 Timestamp (com.google.protobuf.Timestamp)3 IntegrationEventContext (io.spine.server.integration.IntegrationEventContext)3 CommandContext (io.spine.core.CommandContext)2 IntegrationEvent (io.spine.server.integration.IntegrationEvent)2 Any (com.google.protobuf.Any)1 Message (com.google.protobuf.Message)1 TextFormat.shortDebugString (com.google.protobuf.TextFormat.shortDebugString)1 ActorContext (io.spine.core.ActorContext)1 EventId (io.spine.core.EventId)1 RejectionContext (io.spine.core.RejectionContext)1 TenantId (io.spine.core.TenantId)1 GivenEvent (io.spine.core.given.GivenEvent)1