@Test(expected = IllegalStateException.class)
public void shouldThrowExceptionIfSystemUserNotFound() throws Exception {

    when(systemUserProvider.getContextSystemUserId()).thenReturn(Optional.empty());
    systemUserUtil.asEnvelopeWithSystemUserId(envelopeFrom(metadataBuilder().withId(randomUUID()).withName("name"), createObjectBuilder()));
}