/*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2021 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 import lombok.ToString;
 
 /**
- * Class to capture get topic response from dmaap.
+ * Class to capture get topic response from kafka.
  */
 @Getter
 @Setter
 @ToString
-public class DmaapGetTopicResponse {
+public class KafkaGetTopicResponse {
 
     private List<String> topics;
 }
 
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019-2020, 2022-2023 Nordix Foundation.
+ *  Copyright (C) 2019-2020, 2022-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2020-2022 Bell Canada. All rights reserved.
  * ================================================================================
         HealthCheckReport clientReport;
         try {
             Response resp = httpClient.get();
-            if (httpClient.getName().equalsIgnoreCase("dmaap")) {
-                clientReport = verifyDmaapClient(httpClient, resp);
+            if (httpClient.getName().equalsIgnoreCase("kafka")) {
+                clientReport = verifyKafkaClient(httpClient, resp);
             } else {
                 clientReport = replaceIpWithHostname(resp.readEntity(HealthCheckReport.class), httpClient.getBaseUrl());
             }
         return report;
     }
 
-    private HealthCheckReport verifyDmaapClient(HttpClient httpClient, Response resp) {
-        DmaapGetTopicResponse dmaapResponse = resp.readEntity(DmaapGetTopicResponse.class);
-        var topicVerificationStatus = (dmaapResponse.getTopics() != null
-                        && dmaapResponse.getTopics().contains(topicPolicyPdpPap));
-        String message = (topicVerificationStatus ? "PAP to DMaaP connection check is successful"
-                        : "PAP to DMaaP connection check failed");
+    private HealthCheckReport verifyKafkaClient(HttpClient httpClient, Response resp) {
+        KafkaGetTopicResponse kafkaResponse = resp.readEntity(KafkaGetTopicResponse.class);
+        var topicVerificationStatus = (kafkaResponse.getTopics() != null
+                        && kafkaResponse.getTopics().contains(topicPolicyPdpPap));
+        String message = (topicVerificationStatus ? "PAP to Kafka connection check is successful"
+                        : "PAP to Kafka connection check failed");
         int code = (topicVerificationStatus ? resp.getStatus() : 503);
         return createHealthCheckReport(httpClient.getName(), httpClient.getBaseUrl(), code,
                         topicVerificationStatus, message);
 
     topicSources:
     - topic: ${pap.topic.pdp-pap.name}
       servers:
-      - message-router
-      topicCommInfrastructure: dmaap
+      - kafka
+      topicCommInfrastructure: NOOP
       fetchTimeout: 15000
     - topic: ${pap.topic.heartbeat.name}
       effectiveTopic: ${pap.topic.pdp-pap.name}
       consumerGroup: policy-pap
       servers:
-      - message-router
-      topicCommInfrastructure: dmaap
+      - kafka
+      topicCommInfrastructure: NOOP
       fetchTimeout: 15000
     topicSinks:
     - topic: ${pap.topic.pdp-pap.name}
       servers:
-      - message-router
-      topicCommInfrastructure: dmaap
+      - kafka
+      topicCommInfrastructure: NOOP
     - topic: ${pap.topic.notification.name}
       servers:
-      - message-router
-      topicCommInfrastructure: dmaap
+      - kafka
+      topicCommInfrastructure: NOOP
   healthCheckRestClientParameters:
   - clientName: api
     hostname: policy-api
     password: zb!XztG34
     useHttps: true
     basePath: healthcheck
-  - clientName: dmaap
-    hostname: message-router
+  - clientName: kafka
+    hostname: kafka
     port: 3905
     useHttps: true
     basePath: topics
 
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020, 2022-2023 Nordix Foundation.
+ *  Copyright (C) 2020, 2022-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020-2021 AT&T Corp.
  *  Modifications Copyright (C) 2020-2022 Bell Canada. All rights reserved.
  * ================================================================================
         when(response2.readEntity(HealthCheckReport.class)).thenReturn(createReport(HttpURLConnection.HTTP_OK, true));
         when(client2.get()).thenReturn(response2);
 
-        when(client3.getName()).thenReturn("dmaap");
-        when(client3.getBaseUrl()).thenReturn("message-router");
+        when(client3.getName()).thenReturn("kafka");
+        when(client3.getBaseUrl()).thenReturn("kafka");
         when(response3.getStatus()).thenReturn(HttpURLConnection.HTTP_OK);
-        when(response3.readEntity(DmaapGetTopicResponse.class)).thenReturn(createDmaapResponse());
+        when(response3.readEntity(KafkaGetTopicResponse.class)).thenReturn(createKafkaResponse());
         when(client3.get()).thenReturn(response3);
         List<HttpClient> clients = new ArrayList<>();
         clients.add(client1);
         assertFalse(report2.isHealthy());
 
         when(response3.getStatus()).thenReturn(HttpURLConnection.HTTP_INTERNAL_ERROR);
-        when(response3.readEntity(DmaapGetTopicResponse.class)).thenReturn(null);
+        when(response3.readEntity(KafkaGetTopicResponse.class)).thenReturn(null);
         Map<String, Object> result3 = callFetchPolicyComponentsHealthStatus();
         assertFalse((Boolean) result3.get(HEALTHY));
-        HealthCheckReport report3 = (HealthCheckReport) result3.get("dmaap");
+        HealthCheckReport report3 = (HealthCheckReport) result3.get("kafka");
         assertFalse(report3.isHealthy());
 
         when(response3.getStatus()).thenReturn(HttpURLConnection.HTTP_OK);
-        when(response3.readEntity(DmaapGetTopicResponse.class)).thenReturn(new DmaapGetTopicResponse());
+        when(response3.readEntity(KafkaGetTopicResponse.class)).thenReturn(new KafkaGetTopicResponse());
         Map<String, Object> result4 = callFetchPolicyComponentsHealthStatus();
         assertFalse((Boolean) result4.get(HEALTHY));
-        HealthCheckReport report4 = (HealthCheckReport) result4.get("dmaap");
+        HealthCheckReport report4 = (HealthCheckReport) result4.get("kafka");
         assertFalse(report4.isHealthy());
     }
 
         }
     }
 
-    private DmaapGetTopicResponse createDmaapResponse() {
-        DmaapGetTopicResponse response = new DmaapGetTopicResponse();
+    private KafkaGetTopicResponse createKafkaResponse() {
+        KafkaGetTopicResponse response = new KafkaGetTopicResponse();
         response.setTopics(List.of("POLICY-PDP-PAP"));
         return response;
     }
 
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2022-2023 Nordix Foundation.
+ * Modifications Copyright (C) 2022-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
     }
 
     /**
-     * Starts the threads that read the "DMaaP" queues..
+     * Starts the threads that read the "kafka" queues.
      */
     public void startThreads() {
         if (running) {
 
     password: zb!XztG34
     useHttps: true
     basePath: healthcheck
-  - clientName: dmaap
-    hostname: message-router
+  - clientName: kafka
+    hostname: kafka
     port: 3905
     useHttps: true
     basePath: topics
 
     "topicParameterGroup": {
         "topicSources" : [{
             "topic" : "POLICY-PDP-PAP",
-            "servers" : [ "message-router" ],
-            "topicCommInfrastructure" : "dmaap"
+            "servers" : [ "kafka" ],
+            "topicCommInfrastructure" : "NOOP"
         }],
         "topicSinks" : [{
             "topic" : "POLICY-PDP-PAP",
-            "servers" : [ "message-router" ],
-            "topicCommInfrastructure" : "dmaap"
+            "servers" : [ "kafka" ],
+            "topicCommInfrastructure" : "NOOP"
         }]
     },
     "healthCheckRestClientParameters":[{
 
         "basePath": "healthcheck"
     },
     {
-        "clientName": "dmaap",
-        "hostname": "message-router",
+        "clientName": "kafka",
+        "hostname": "kafka",
         "port": 3905,
         "useHttps": true,
         "basePath": "topics"
 
     "topicParameterGroup": {
         "topicSources" : [{
             "topic" : "POLICY-PDP-PAP",
-            "servers" : [ "message-router" ],
+            "servers" : [ "kafka" ],
             "topicCommInfrastructure" : "noop"
         },
         {
             "topic" : "POLICY-HEARTBEAT",
             "effectiveTopic": "POLICY-PDP-PAP",
             "consumerGroup": "policy-pap",
-            "servers" : [ "message-router" ],
+            "servers" : [ "kafka" ],
             "topicCommInfrastructure" : "noop"
         }],
         "topicSinks" : [{
         "basePath": "healthcheck"
     },
     {
-        "clientName": "dmaap",
-        "hostname": "message-router",
+        "clientName": "kafka",
+        "hostname": "kafka",
         "port": 3905,
         "useHttps": true,
         "basePath": "topics"
 
         "topicSources" : [{
             "topic" : "POLICY-PDP-PAP",
             "servers" : [ "localhost:3904" ],
-            "topicCommInfrastructure" : "dmaap"
+            "topicCommInfrastructure" : "NOOP"
         }],
         "topicSinks" : [{
             "topic" : "POLICY-PDP-PAP",
             "servers" : [ "localhost:3904" ],
-            "topicCommInfrastructure" : "dmaap"
+            "topicCommInfrastructure" : "NOOP"
         },{
             "topic" : "POLICY-NOTIFICATION",
             "servers" : [ "localhost:3904" ],
-            "topicCommInfrastructure" : "dmaap"
+            "topicCommInfrastructure" : "NOOP"
         }]
     },
     "healthCheckRestClientParameters":[{
 
     topicSources:
     - topic: POLICY-PDP-PAP
       servers:
-      - message-router
-      topicCommInfrastructure: dmaap
+      - kafka
+      topicCommInfrastructure: NOOP
       fetchTimeout: 15000
     - topic: POLICY-HEARTBEAT
       effectiveTopic: POLICY-PDP-PAP
       consumerGroup: policy-pap
       servers:
-      - message-router
-      topicCommInfrastructure: dmaap
+      - kafka
+      topicCommInfrastructure: NOOP
       fetchTimeout: 15000
     topicSinks:
     - topic: POLICY-PDP-PAP
       servers:
-      - message-router
-      topicCommInfrastructure: dmaap
+      - kafka
+      topicCommInfrastructure: NOOP
     - topic: POLICY-NOTIFICATION
       servers:
-      - message-router
-      topicCommInfrastructure: dmaap
+      - kafka
+      topicCommInfrastructure: NOOP
   healthCheckRestClientParameters:
   - clientName: api
     hostname: policy-api
     password: zb!XztG34
     useHttps: true
     basePath: healthcheck
-  - clientName: dmaap
-    hostname: message-router
+  - clientName: kafka
+    hostname: kafka
     port: 3905
     useHttps: true
     basePath: topics
 
         "topicSources" : [{
             "topic" : "POLICY-PDP-PAP",
             "servers" : [ "10.2.0.41:3904" ],
-            "topicCommInfrastructure" : "dmaap",
+            "topicCommInfrastructure" : "NOOP",
             "fetchTimeout": 15000
         },
         {
             "effectiveTopic": "POLICY-PDP-PAP",
             "consumerGroup": "policy-pap",
             "servers" : [ "10.2.0.41:3904" ],
-            "topicCommInfrastructure" : "dmaap",
+            "topicCommInfrastructure" : "NOOP",
             "fetchTimeout": 15000
         }],
         "topicSinks" : [{
             "topic" : "POLICY-PDP-PAP",
             "servers" : [ "10.2.0.41:3904" ],
-            "topicCommInfrastructure" : "dmaap"
+            "topicCommInfrastructure" : "NOOP"
         },
         {
             "topic" : "POLICY-NOTIFICATION",
             "servers" : [ "10.2.0.41:3904" ],
-            "topicCommInfrastructure" : "dmaap"
+            "topicCommInfrastructure" : "NOOP"
         }]
     }
 }