From 284a7ac28005033db1ddeb63b494fbb31223f3c8 Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Fri, 8 Dec 2023 11:25:35 +0000 Subject: [PATCH] fix : sonar Issue --- .../example/catalogservice/services/ProductService.java | 8 ++++---- .../orderservice/config/kafka/KafkaStreamsConfig.java | 2 +- test-em-all.sh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/catalog-service/src/main/java/com/example/catalogservice/services/ProductService.java b/catalog-service/src/main/java/com/example/catalogservice/services/ProductService.java index 9d6c4a1e..c456a91d 100644 --- a/catalog-service/src/main/java/com/example/catalogservice/services/ProductService.java +++ b/catalog-service/src/main/java/com/example/catalogservice/services/ProductService.java @@ -135,10 +135,10 @@ public Mono findProductById(Long id) { productResponse -> getInventoryByProductCode(productResponse.code()) .map( - inventoryDto -> { - return productResponse.withInStock( - inventoryDto.availableQuantity() > 0); - })); + inventoryDto -> + productResponse.withInStock( + inventoryDto.availableQuantity() + > 0))); } private Mono getInventoryByProductCode(String code) { diff --git a/order-service/src/main/java/com/example/orderservice/config/kafka/KafkaStreamsConfig.java b/order-service/src/main/java/com/example/orderservice/config/kafka/KafkaStreamsConfig.java index 15cf6cf7..8b342810 100644 --- a/order-service/src/main/java/com/example/orderservice/config/kafka/KafkaStreamsConfig.java +++ b/order-service/src/main/java/com/example/orderservice/config/kafka/KafkaStreamsConfig.java @@ -67,7 +67,7 @@ KafkaStreamsConfiguration defaultKafkaStreamsConfig( KafkaConnectionDetails connectionDetails, KafkaProperties kafkaProperties, DeadLetterPublishingRecoverer deadLetterPublishingRecoverer) { - Map properties = kafkaProperties.buildStreamsProperties(); + Map properties = kafkaProperties.buildStreamsProperties(null); properties.put( ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, connectionDetails.getStreamsBootstrapServers()); diff --git a/test-em-all.sh b/test-em-all.sh index 46cef785..871f64d4 100755 --- a/test-em-all.sh +++ b/test-em-all.sh @@ -142,7 +142,7 @@ function setupTestData() { # Verify that communication between catalog-service and inventory service is established assertCurl 200 "curl -k http://$HOST:$PORT/catalog-service/api/catalog/productCode/$PROD_CODE_1?fetchInStock=true" - assertEqual $PROD_CODE_1 $(echo ${RESPONSE} | jq .code) + assertEqual \"${PROD_CODE_1}\" $(echo ${RESPONSE} | jq .code) assertEqual \"true\" $(echo ${RESPONSE} | jq .inStock) body="{\"name\": \"$CUSTOMER_NAME"