@Test void convertWithApiRequestData() { ActorBase actor = ActorCrn.builder().withActorCrn(USER_CRN).build(); EventData eventData = ApiRequestData.builder() .withApiVersion(API_VERSION) .withMutating(MUTATING) .withRequestParameters(REQUEST_PARAMETERS) .withUserAgent(USER_AGENT) .build(); AuditEvent source = makeAuditEvent(actor, eventData); underTest = new AuditEventToGrpcAuditEventConverter(createMockUtilizer(ApiRequestData.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);  }