From 87f4c375d1f034634b663f641fbe45ab2d0b6c67 Mon Sep 17 00:00:00 2001 From: BKadirkhodjaev Date: Thu, 31 Oct 2024 18:06:47 +0500 Subject: [PATCH] [MODAUD-195]. Fix sonar issues --- .../acquisition/consumers/InvoiceEventsHandler.java | 6 +++--- .../org/folio/rest/impl/InvoiceEventsHandlerMockTest.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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); }