Allow not setting catalog facade config 71/143371/2
authorFiete Ostkamp <fiete.ostkamp@telekom.de>
Mon, 23 Feb 2026 20:17:25 +0000 (21:17 +0100)
committerLukasz Rajewski <lukasz.rajewski@t-mobile.pl>
Tue, 24 Feb 2026 07:03:09 +0000 (07:03 +0000)
Issue-ID: SDC-4764
Change-Id: Ibc55a3f86aab527fcb024b99547038b1fc79d35f
Signed-off-by: Fiete Ostkamp <fiete.ostkamp@telekom.de>
catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTask.java
catalog-fe/src/test/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTaskTest.java

index c7c0e9e..b1caace 100644 (file)
@@ -165,14 +165,17 @@ public class HealthCheckScheduledTask implements Runnable {
         return certificateInfoConfigured ? clientCertificate: null;
     }
 
-    private String getExternalComponentHcUri(String baseComponent) {
+    @VisibleForTesting
+    String getExternalComponentHcUri(String baseComponent) {
         String healthCheckUri = null;
         switch (baseComponent) {
             case HC_COMPONENT_ON_BOARDING:
                 healthCheckUri = service.getConfig().getOnboarding().getHealthCheckUriFe();
                 break;
             case HC_COMPONENT_CATALOG_FACADE_MS:
-                healthCheckUri = service.getConfig().getCatalogFacadeMs().getHealthCheckUri();
+                if (service.getConfig().getCatalogFacadeMs() != null) {
+                    healthCheckUri = service.getConfig().getCatalogFacadeMs().getHealthCheckUri();
+                }
                 break;
             default:
                 log.debug("Unsupported base component {}", baseComponent);
index 38863f5..77e8fd6 100644 (file)
@@ -81,6 +81,12 @@ public class HealthCheckScheduledTaskTest {
         assertNull(healthCheckScheduledTask.getExternalComponentHcUrl("test"));
     }
 
+    @Test
+    public void getCatalogFacadeMsUriWhenConfigurationIsNull_shouldReturnNullWithoutNPE() {
+        when(configuration.getCatalogFacadeMs()).thenReturn(null);
+        assertNull(healthCheckScheduledTask.getExternalComponentHcUri(Constants.HC_COMPONENT_CATALOG_FACADE_MS));
+    }
+
     @Test
     public void getOnboardingUrlWhenConfigurationIsProvided() {
         when(configuration.getOnboarding()).thenReturn(onboardingConfig);