diff --git a/mod-audit-server/src/main/java/org/folio/verticle/acquisition/consumers/InvoiceEventsHandler.java b/mod-audit-server/src/main/java/org/folio/verticle/acquisition/consumers/InvoiceEventsHandler.java index b881562..e24ffdf 100644 --- a/mod-audit-server/src/main/java/org/folio/verticle/acquisition/consumers/InvoiceEventsHandler.java +++ b/mod-audit-server/src/main/java/org/folio/verticle/acquisition/consumers/InvoiceEventsHandler.java @@ -34,11 +34,11 @@ public InvoiceEventsHandler(@Autowired Vertx vertx, } @Override - public Future handle(KafkaConsumerRecord record) { + public Future handle(KafkaConsumerRecord kafkaConsumerRecord) { Promise result = Promise.promise(); - List kafkaHeaders = record.headers(); + List kafkaHeaders = kafkaConsumerRecord.headers(); OkapiConnectionParams okapiConnectionParams = new OkapiConnectionParams(KafkaHeaderUtils.kafkaHeadersToMap(kafkaHeaders), vertx); - InvoiceAuditEvent event = new JsonObject(record.value()).mapTo(InvoiceAuditEvent.class); + InvoiceAuditEvent event = new JsonObject(kafkaConsumerRecord.value()).mapTo(InvoiceAuditEvent.class); LOGGER.info("handle:: Starting processing of Invoice audit event with id: {} for invoice id: {}", event.getId(), event.getInvoiceId()); invoiceAuditEventsService.saveInvoiceAuditEvent(event, okapiConnectionParams.getTenantId()) diff --git a/mod-audit-server/src/test/java/org/folio/rest/impl/InvoiceEventsHandlerMockTest.java b/mod-audit-server/src/test/java/org/folio/rest/impl/InvoiceEventsHandlerMockTest.java index 3c6fbfc..966f85f 100644 --- a/mod-audit-server/src/test/java/org/folio/rest/impl/InvoiceEventsHandlerMockTest.java +++ b/mod-audit-server/src/test/java/org/folio/rest/impl/InvoiceEventsHandlerMockTest.java @@ -78,9 +78,9 @@ void shouldNotProcessEvent() { Assertions.assertTrue(save.failed()); } - private KafkaConsumerRecord buildKafkaConsumerRecord(InvoiceAuditEvent record) { - String topic = KafkaTopicNameHelper.formatTopicName(KAFKA_ENV, getDefaultNameSpace(), TENANT_ID, record.getAction().toString()); - ConsumerRecord consumerRecord = buildConsumerRecord(topic, record); + private KafkaConsumerRecord buildKafkaConsumerRecord(InvoiceAuditEvent kafkaConsumerRecord) { + String topic = KafkaTopicNameHelper.formatTopicName(KAFKA_ENV, getDefaultNameSpace(), TENANT_ID, kafkaConsumerRecord.getAction().toString()); + ConsumerRecord consumerRecord = buildConsumerRecord(topic, kafkaConsumerRecord); return new KafkaConsumerRecordImpl<>(consumerRecord); }