aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2023-08-29 09:34:06 +0200
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2023-08-29 09:35:26 +0200
commitafe2aaffdd5679e61f27f7b5597b21db6a8db4e0 (patch)
treee6221a8a1f708332c0afeb1cf0634ba46419096a
parent4b7cd5405dea9003f31af1aa9cd584d8ccf2141f (diff)
Consistently use the preferences and history names in the bff code base - Part 2
- 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>
-rw-r--r--app/src/main/resources/application-development.yml2
-rw-r--r--app/src/main/resources/application.yml2
-rw-r--r--app/src/test/java/org/onap/portalng/bff/actions/CreateActionsIntegrationTest.java2
-rw-r--r--app/src/test/java/org/onap/portalng/bff/actions/ListActionsIntegrationTest.java2
-rw-r--r--development/.env14
-rw-r--r--development/docker-compose.yml16
-rw-r--r--lib/src/main/java/org/onap/portalng/bff/config/clients/HistoryConfig.java4
-rw-r--r--lib/src/main/java/org/onap/portalng/bff/services/ActionService.java8
-rw-r--r--openapi/server/src/main/resources/static/api.yaml3
9 files changed, 26 insertions, 27 deletions
diff --git a/app/src/main/resources/application-development.yml b/app/src/main/resources/application-development.yml
index e5de9be..d68870f 100644
--- a/app/src/main/resources/application-development.yml
+++ b/app/src/main/resources/application-development.yml
@@ -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}
diff --git a/app/src/main/resources/application.yml b/app/src/main/resources/application.yml
index 2d09bbb..0bbd9e2 100644
--- a/app/src/main/resources/application.yml
+++ b/app/src/main/resources/application.yml
@@ -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}
diff --git a/app/src/test/java/org/onap/portalng/bff/actions/CreateActionsIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/actions/CreateActionsIntegrationTest.java
index 748d568..06ccef9 100644
--- a/app/src/test/java/org/onap/portalng/bff/actions/CreateActionsIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/actions/CreateActionsIntegrationTest.java
@@ -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());
diff --git a/app/src/test/java/org/onap/portalng/bff/actions/ListActionsIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/actions/ListActionsIntegrationTest.java
index 5acc4f4..336ce4c 100644
--- a/app/src/test/java/org/onap/portalng/bff/actions/ListActionsIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/actions/ListActionsIntegrationTest.java
@@ -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());
}
diff --git a/development/.env b/development/.env
index f8e9c18..dfc9a4f 100644
--- a/development/.env
+++ b/development/.env
@@ -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
diff --git a/development/docker-compose.yml b/development/docker-compose.yml
index 9cca867..465741c 100644
--- a/development/docker-compose.yml
+++ b/development/docker-compose.yml
@@ -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:
diff --git a/lib/src/main/java/org/onap/portalng/bff/config/clients/HistoryConfig.java b/lib/src/main/java/org/onap/portalng/bff/config/clients/HistoryConfig.java
index c7f8709..9d64ef1 100644
--- a/lib/src/main/java/org/onap/portalng/bff/config/clients/HistoryConfig.java
+++ b/lib/src/main/java/org/onap/portalng/bff/config/clients/HistoryConfig.java
@@ -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();
}
diff --git a/lib/src/main/java/org/onap/portalng/bff/services/ActionService.java b/lib/src/main/java/org/onap/portalng/bff/services/ActionService.java
index cb7b6b4..bb272a1 100644
--- a/lib/src/main/java/org/onap/portalng/bff/services/ActionService.java
+++ b/lib/src/main/java/org/onap/portalng/bff/services/ActionService.java
@@ -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);
});
}
diff --git a/openapi/server/src/main/resources/static/api.yaml b/openapi/server/src/main/resources/static/api.yaml
index f601785..2dfc694 100644
--- a/openapi/server/src/main/resources/static/api.yaml
+++ b/openapi/server/src/main/resources/static/api.yaml
@@ -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