@Test void convertUnknownActorThrows() { class Unknown extends ActorBase { } AuditEvent source = makeAuditEvent(new Unknown(), null); assertThatThrownBy(() -> underTest.convert(source)).isInstanceOf(IllegalArgumentException.class); }
public AuditProto.AuditEvent convert(AuditEvent source) { String id = Optional.ofNullable(source.getId()).orElseGet(uuidSupplier()); String requestId = Optional.ofNullable(source.getRequestId()).orElseGet(uuidSupplier()); AuditProto.AuditEvent.Builder auditEventBuilder = prepareBuilderForCreateAuditEvent(source, id, requestId); updateAuditEventActor(auditEventBuilder, source.getActor()); updateAuditEventData(auditEventBuilder, source.getEventData()); return auditEventBuilder.build(); }
AuditEventToGrpcAuditEventConverter { public AuditProto.AuditEvent convert(AuditEvent source) { String id = Optional.ofNullable(source.getId()).orElseGet(uuidSupplier()); String requestId = Optional.ofNullable(source.getRequestId()).orElseGet(uuidSupplier()); AuditProto.AuditEvent.Builder auditEventBuilder = prepareBuilderForCreateAuditEvent(source, id, requestId); updateAuditEventActor(auditEventBuilder, source.getActor()); updateAuditEventData(auditEventBuilder, source.getEventData()); return auditEventBuilder.build(); } }
AuditEventToGrpcAuditEventConverter { public AuditProto.AuditEvent convert(AuditEvent source) { String id = Optional.ofNullable(source.getId()).orElseGet(uuidSupplier()); String requestId = Optional.ofNullable(source.getRequestId()).orElseGet(uuidSupplier()); AuditProto.AuditEvent.Builder auditEventBuilder = prepareBuilderForCreateAuditEvent(source, id, requestId); updateAuditEventActor(auditEventBuilder, source.getActor()); updateAuditEventData(auditEventBuilder, source.getEventData()); return auditEventBuilder.build(); } AuditEventToGrpcAuditEventConverter(Map<Class, AuditEventBuilderUpdater> builderUpdaters, AuditEventBuilderProvider builderProvider); }
AuditEventToGrpcAuditEventConverter { public AuditProto.AuditEvent convert(AuditEvent source) { String id = Optional.ofNullable(source.getId()).orElseGet(uuidSupplier()); String requestId = Optional.ofNullable(source.getRequestId()).orElseGet(uuidSupplier()); AuditProto.AuditEvent.Builder auditEventBuilder = prepareBuilderForCreateAuditEvent(source, id, requestId); updateAuditEventActor(auditEventBuilder, source.getActor()); updateAuditEventData(auditEventBuilder, source.getEventData()); return auditEventBuilder.build(); } AuditEventToGrpcAuditEventConverter(Map<Class, AuditEventBuilderUpdater> builderUpdaters, AuditEventBuilderProvider builderProvider); AuditProto.AuditEvent convert(AuditEvent source); }
AuditEventToGrpcAuditEventConverter { public AuditProto.AuditEvent convert(AuditEvent source) { String id = Optional.ofNullable(source.getId()).orElseGet(uuidSupplier()); String requestId = Optional.ofNullable(source.getRequestId()).orElseGet(uuidSupplier()); AuditProto.AuditEvent.Builder auditEventBuilder = prepareBuilderForCreateAuditEvent(source, id, requestId); updateAuditEventActor(auditEventBuilder, source.getActor()); updateAuditEventData(auditEventBuilder, source.getEventData()); return auditEventBuilder.build(); } AuditEventToGrpcAuditEventConverter(Map<Class, AuditEventBuilderUpdater> builderUpdaters, AuditEventBuilderProvider builderProvider); AuditProto.AuditEvent convert(AuditEvent source);  }