Consistently use the preferences and history names in the bff code base - Part 2 43/135843/1
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Tue, 29 Aug 2023 07:34:06 +0000 (09:34 +0200)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Tue, 29 Aug 2023 07:35:26 +0000 (09:35 +0200)
- some history related properties still had a portal prefix

Issue-ID: PORTALNG-50
Change-Id: Ia044b42c306b8a8837d1cda92f101aebe62283a1
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
app/src/main/resources/application-development.yml
app/src/main/resources/application.yml
app/src/test/java/org/onap/portalng/bff/actions/CreateActionsIntegrationTest.java
app/src/test/java/org/onap/portalng/bff/actions/ListActionsIntegrationTest.java
development/.env
development/docker-compose.yml
lib/src/main/java/org/onap/portalng/bff/config/clients/HistoryConfig.java
lib/src/main/java/org/onap/portalng/bff/services/ActionService.java
openapi/server/src/main/resources/static/api.yaml

index e5de9be..d68870f 100644 (file)
@@ -25,5 +25,5 @@ management:
 bff:
   realm: ONAP
   preferences-url: ${PREFERENCES_URL}
-  history-url: ${PORTAL_HISTORY_URL}
+  history-url: ${HISTORY_URL}
   keycloak-url: ${KEYCLOAK_URL}
index 2d09bbb..0bbd9e2 100644 (file)
@@ -43,6 +43,6 @@ spring:
 bff:
   realm: ${KEYCLOAK_REALM}
   preferences-url: ${PREFERENCES_URL}
-  history-url: ${PORTAL_HISTORY_URL}
+  history-url: ${HISTORY_URL}
   keycloak-url: ${KEYCLOAK_URL}
 
index 748d568..06ccef9 100644 (file)
@@ -77,7 +77,7 @@ class CreateActionsIntegrationTest extends ActionsMocks {
     final ProblemApiDto response = createActionProblem(createActionDto, userId);
 
     assertThat(response.getDownstreamSystem())
-        .isEqualTo(ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY);
+        .isEqualTo(ProblemApiDto.DownstreamSystemEnum.HISTORY);
 
     assertThat(response.getDownstreamStatus()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value());
     assertThat(response.getDetail()).isEqualTo(problemHistoryDto.getDetail());
index 5acc4f4..336ce4c 100644 (file)
@@ -70,7 +70,7 @@ class ListActionsIntegrationTest extends ActionsMocks {
     final ProblemApiDto response = listActionsProblem();
 
     assertThat(response.getDownstreamSystem())
-        .isEqualTo(ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY);
+        .isEqualTo(ProblemApiDto.DownstreamSystemEnum.HISTORY);
     assertThat(response.getDownstreamStatus()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value());
     assertThat(response.getDetail()).isEqualTo(problemHistoryDto.getDetail());
   }
index f8e9c18..dfc9a4f 100644 (file)
@@ -30,11 +30,11 @@ PORTALPREFS_HOST:mongo-preferences
 PORTALPREFS_PORT:27017
 
 # history
-PORTAL_HISTORY_IMAGE_NAME=history
-PORTAL_HISTORY_IMAGE_TAG=0.1.1-de369ace
-PORTALHISTORY_USERNAME:root
-PORTALHISTORY_PASSWORD:password
-PORTALHISTORY_DATABASE:History
-PORTALHISTORY_HOST:mongo-history
-PORTALHISTORY_PORT:27017
+HISTORY_IMAGE_NAME=history
+HISTORY_IMAGE_TAG=0.1.1-de369ace
+HISTORY_USERNAME:root
+HISTORY_PASSWORD:password
+HISTORY_DATABASE:History
+HISTORY_HOST:mongo-history
+HISTORY_PORT:27017
 
index 9cca867..465741c 100644 (file)
@@ -37,21 +37,21 @@ services:
     container_name: mongo-history
     image: "${MONGO_IMAGE}:${MONGO_VERSION}"
     environment:
-      MONGO_INITDB_ROOT_USERNAME: ${PORTALHISTORY_USERNAME}
-      MONGO_INITDB_ROOT_PASSWORD: ${PORTALHISTORY_PASSWORD}
+      MONGO_INITDB_ROOT_USERNAME: ${HISTORY_USERNAME}
+      MONGO_INITDB_ROOT_PASSWORD: ${HISTORY_PASSWORD}
   history:
     container_name: history
-    image: "${IMAGE_REPOSITORY}/${PORTAL_HISTORY_IMAGE_NAME}:${PORTAL_HISTORY_IMAGE_TAG}"
+    image: "${IMAGE_REPOSITORY}/${HISTORY_IMAGE_NAME}:${HISTORY_IMAGE_TAG}"
     ports:
       - 9002:9002
     environment:
-      PORTALHISTORY_USERNAME: ${PORTALHISTORY_USERNAME}
-      PORTALHISTORY_PASSWORD: ${PORTALHISTORY_PASSWORD}
-      PORTALHISTORY_DATABASE: ${PORTALHISTORY_DATABASE}
+      HISTORY_USERNAME: ${HISTORY_USERNAME}
+      HISTORY_PASSWORD: ${HISTORY_PASSWORD}
+      HISTORY_DATABASE: ${HISTORY_DATABASE}
       KEYCLOAK_URL: ${KEYCLOAK_URL}
       KEYCLOAK_REALM: ${KEYCLOAK_REALM}
-      PORTALHISTORY_HOST: ${PORTALHISTORY_HOST}
-      PORTALHISTORY_PORT: ${PORTALHISTORY_PORT}
+      HISTORY_HOST: ${HISTORY_HOST}
+      HISTORY_PORT: ${HISTORY_PORT}
     depends_on:
       - mongo-history
   mongo-preferences:
index c7f8709..9d64ef1 100644 (file)
@@ -60,7 +60,7 @@ public class HistoryConfig extends AbstractClientConfig<ProblemHistoryDto> {
   }
 
   @Bean
-  public ActionsApi portalHistoryActionApi(WebClient.Builder webClientBuilder) {
+  public ActionsApi historyActionApi(WebClient.Builder webClientBuilder) {
     return constructApiClient(webClientBuilder, ActionsApi::new);
   }
 
@@ -88,7 +88,7 @@ public class HistoryConfig extends AbstractClientConfig<ProblemHistoryDto> {
         .title(httpStatusCode.toString())
         .detail(errorResponse.getDetail())
         .downstreamMessageId(errorResponse.getType())
-        .downstreamSystem(ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY.toString())
+        .downstreamSystem(ProblemApiDto.DownstreamSystemEnum.HISTORY.toString())
         .downstreamStatus(httpStatusCode.value())
         .build();
   }
index cb7b6b4..bb272a1 100644 (file)
@@ -64,7 +64,7 @@ public class ActionService {
                   xRequestId,
                   "Create actions failed for userId",
                   userId,
-                  ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY.toString());
+                  ProblemApiDto.DownstreamSystemEnum.HISTORY.toString());
               return Mono.error(ex);
             });
   }
@@ -82,7 +82,7 @@ public class ActionService {
                   xRequestId,
                   "Get actions failed for userId",
                   userId,
-                  ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY.toString());
+                  ProblemApiDto.DownstreamSystemEnum.HISTORY.toString());
               return Mono.error(ex);
             });
   }
@@ -101,7 +101,7 @@ public class ActionService {
                   xRequestId,
                   "List actions failed",
                   null,
-                  ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY.toString());
+                  ProblemApiDto.DownstreamSystemEnum.HISTORY.toString());
               return Mono.error(ex);
             });
   }
@@ -118,7 +118,7 @@ public class ActionService {
                       + deleteAfterHours
                       + " hours",
                   userId,
-                  ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY.toString());
+                  ProblemApiDto.DownstreamSystemEnum.HISTORY.toString());
               return Mono.error(ex);
             });
   }
index f601785..2dfc694 100644 (file)
@@ -733,9 +733,8 @@ components:
           description: The downstream system that responded with error
           enum:
             - KEYCLOAK
-            - PORTAL_SERVICE
             - PREFERENCES
-            - PORTAL_HISTORY
+            - HISTORY
         downstreamStatus:
           type: integer
           format: int32