@Test void convertWithServiceEventData() { ActorBase actor = ActorCrn.builder().withActorCrn(USER_CRN).build(); EventData eventData = ServiceEventData.builder() .withVersion(SERVICE_EVENT_VERSION) .withEventDetails(SERVICE_EVENT_DETAILS) .build(); AuditEvent source = makeAuditEvent(actor, eventData); underTest = new AuditEventToGrpcAuditEventConverter(createMockUtilizer(ServiceEventData.class), mockBuilderProvider); underTest.convert(source); assertGeneric(); verify(mockAuditEventBuilderUpdater, times(1)).update(any(), any()); }
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);  }