Search in sources :

Example 11 with EventFoundEvent

use of uk.gov.justice.services.core.extension.EventFoundEvent in project microservice_framework by CJSCommonPlatform.

the class DefaultAggregateServiceIT method shouldThrowExceptionForNonInstantiatableEvent.

@Test(expected = RuntimeException.class)
public void shouldThrowExceptionForNonInstantiatableEvent() throws EventStreamException {
    final EventStream eventStream = eventSource.getStreamById(STREAM_ID);
    aggregateService.register(new EventFoundEvent(EventA.class, "eventA"));
    aggregateService.get(eventStream, PrivateAggregate.class);
}
Also used : EventFoundEvent(uk.gov.justice.services.core.extension.EventFoundEvent) EventStream(uk.gov.justice.services.eventsourcing.source.core.EventStream) EnvelopeEventStream(uk.gov.justice.services.eventsourcing.source.core.EnvelopeEventStream) EventA(uk.gov.justice.services.core.aggregate.event.EventA) Test(org.junit.Test)

Aggregations

EventFoundEvent (uk.gov.justice.services.core.extension.EventFoundEvent)11 Test (org.junit.Test)9 JsonEnvelope (uk.gov.justice.services.messaging.JsonEnvelope)5 EventA (uk.gov.justice.services.core.aggregate.event.EventA)4 TestAggregate (uk.gov.justice.domain.aggregate.TestAggregate)3 EnvelopeEventStream (uk.gov.justice.services.eventsourcing.source.core.EnvelopeEventStream)3 EventStream (uk.gov.justice.services.eventsourcing.source.core.EventStream)3 EventB (uk.gov.justice.services.core.aggregate.event.EventB)2 DefaultEnveloper (uk.gov.justice.services.core.enveloper.DefaultEnveloper)2 JsonObject (javax.json.JsonObject)1 InitialContext (javax.naming.InitialContext)1 Before (org.junit.Before)1 Event (uk.gov.justice.domain.annotation.Event)1 EventA (uk.gov.justice.domain.event.EventA)1 ObjectToJsonValueConverter (uk.gov.justice.services.common.converter.ObjectToJsonValueConverter)1 ObjectMapperProducer (uk.gov.justice.services.common.converter.jackson.ObjectMapperProducer)1 UtcClock (uk.gov.justice.services.common.util.UtcClock)1 Metadata (uk.gov.justice.services.messaging.Metadata)1