@Test(expected = IllegalStateException.class)
public void shouldThrowExceptionForUnregisteredEvent() {

    when(eventStream.getId()).thenReturn(STREAM_ID);
    JsonObject eventPayloadA = mock(JsonObject.class);
    EventA eventA = mock(EventA.class);
    when(jsonObjectToObjectConverter.convert(eventPayloadA, EventA.class)).thenReturn(eventA);
    when(eventStream.read()).thenReturn(Stream.of(envelopeFrom(metadataBuilder()
            .withStreamId(STREAM_ID)
            .withId(randomUUID())
            .withName("eventA"), eventPayloadA)));
    aggregateService.get(eventStream, TestAggregate.class);
}