aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/build.gradle10
-rw-r--r--app/src/main/resources/application-access-control.yml2
-rw-r--r--app/src/main/resources/application-development.yml5
-rw-r--r--app/src/main/resources/application-local.yml5
-rw-r--r--app/src/main/resources/application.yml5
-rw-r--r--app/src/test/java/org/onap/portalng/bff/actions/ActionFixtures.java26
-rw-r--r--app/src/test/java/org/onap/portalng/bff/actions/ActionsMocks.java39
-rw-r--r--app/src/test/java/org/onap/portalng/bff/actions/CreateActionsIntegrationTest.java22
-rw-r--r--app/src/test/java/org/onap/portalng/bff/actions/GetActionsIntegrationTest.java20
-rw-r--r--app/src/test/java/org/onap/portalng/bff/actions/ListActionsIntegrationTest.java23
-rw-r--r--app/src/test/java/org/onap/portalng/bff/headers/XRequestIdHeaderTest.java10
-rw-r--r--app/src/test/java/org/onap/portalng/bff/preferences/CreatePreferencesIntegrationTest.java30
-rw-r--r--app/src/test/java/org/onap/portalng/bff/preferences/GetPreferencesIntegrationTest.java14
-rw-r--r--app/src/test/java/org/onap/portalng/bff/preferences/PreferencesMocks.java38
-rw-r--r--app/src/test/java/org/onap/portalng/bff/preferences/UpdatePreferencesIntegrationTest.java28
-rw-r--r--app/src/test/java/org/onap/portalng/bff/roles/ListRealmRolesIntegrationTest.java4
-rw-r--r--app/src/test/java/org/onap/portalng/bff/roles/RolesMocks.java2
-rw-r--r--app/src/test/java/org/onap/portalng/bff/users/CreateUserIntegrationTest.java8
-rw-r--r--app/src/test/java/org/onap/portalng/bff/users/DeleteUserIntegrationTest.java2
-rw-r--r--app/src/test/java/org/onap/portalng/bff/users/GetUserDetailIntegrationTest.java6
-rw-r--r--app/src/test/java/org/onap/portalng/bff/users/ListAssignedRolesIntegrationTest.java4
-rw-r--r--app/src/test/java/org/onap/portalng/bff/users/ListAvailableRolesIntegrationTest.java4
-rw-r--r--app/src/test/java/org/onap/portalng/bff/users/ListUsersIntegrationTest.java6
-rw-r--r--app/src/test/java/org/onap/portalng/bff/users/UpdateAssignedRolesIntegrationTest.java4
-rw-r--r--app/src/test/java/org/onap/portalng/bff/users/UpdateUserIntegrationTest.java6
-rw-r--r--app/src/test/java/org/onap/portalng/bff/users/UpdateUserPasswordIntegrationTest.java4
-rw-r--r--app/src/test/resources/application-access-control.yml2
-rw-r--r--app/src/test/resources/application-development.yml5
-rw-r--r--app/src/test/resources/application.yml5
29 files changed, 158 insertions, 181 deletions
diff --git a/app/build.gradle b/app/build.gradle
index 7ad65cd..4305de0 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -19,15 +19,11 @@ configurations {
}
}
-// repositories {
-// mavenCentral()
-// }
-
dependencies {
implementation project(':openapi:server')
- implementation project(':openapi:client-portal-history')
- implementation project(':openapi:client-portal-prefs')
- implementation project(':openapi:client-portal-keycloak')
+ implementation project(':openapi:client-history')
+ implementation project(':openapi:client-preferences')
+ implementation project(':openapi:client-keycloak')
implementation project(':lib')
implementation 'org.springframework.boot:spring-boot-starter-webflux'
diff --git a/app/src/main/resources/application-access-control.yml b/app/src/main/resources/application-access-control.yml
index 450ab8a..ac83409 100644
--- a/app/src/main/resources/application-access-control.yml
+++ b/app/src/main/resources/application-access-control.yml
@@ -9,8 +9,6 @@ bff.access-control:
PREFERENCES_GET: [onap_admin, onap_designer, onap_operator]
PREFERENCES_UPDATE: [onap_admin, onap_designer, onap_operator]
ROLE_LIST: ["*"]
- TILE_GET: [onap_admin, onap_designer, onap_operator]
- TILE_LIST: [onap_admin, onap_designer, onap_operator]
USER_CREATE: [onap_admin, onap_designer, onap_operator]
USER_DELETE: [onap_admin, onap_designer, onap_operator]
USER_GET: [onap_admin, onap_designer, onap_operator]
diff --git a/app/src/main/resources/application-development.yml b/app/src/main/resources/application-development.yml
index c7e869f..e5de9be 100644
--- a/app/src/main/resources/application-development.yml
+++ b/app/src/main/resources/application-development.yml
@@ -24,7 +24,6 @@ management:
bff:
realm: ONAP
- portal-prefs-url: ${PORTAL_PREFS_URL}
- portal-history-url: ${PORTAL_HISTORY_URL}
+ preferences-url: ${PREFERENCES_URL}
+ history-url: ${PORTAL_HISTORY_URL}
keycloak-url: ${KEYCLOAK_URL}
- instance-id: PORTAL
diff --git a/app/src/main/resources/application-local.yml b/app/src/main/resources/application-local.yml
index 0cb6e6b..2eb3278 100644
--- a/app/src/main/resources/application-local.yml
+++ b/app/src/main/resources/application-local.yml
@@ -24,10 +24,9 @@ management:
bff:
realm: ONAP
- portal-prefs-url: http://localhost:9001
- portal-history-url: http://localhost:9002
+ preferences-url: http://localhost:9001
+ history-url: http://localhost:9002
keycloak-url: http://localhost:8080/
- instance-id: PORTAL
logging:
level:
diff --git a/app/src/main/resources/application.yml b/app/src/main/resources/application.yml
index 6e74453..2d09bbb 100644
--- a/app/src/main/resources/application.yml
+++ b/app/src/main/resources/application.yml
@@ -42,8 +42,7 @@ spring:
bff:
realm: ${KEYCLOAK_REALM}
- portal-prefs-url: ${PORTAL_PREFS_URL}
- portal-history-url: ${PORTAL_HISTORY_URL}
+ preferences-url: ${PREFERENCES_URL}
+ history-url: ${PORTAL_HISTORY_URL}
keycloak-url: ${KEYCLOAK_URL}
- instance-id: PORTAL
diff --git a/app/src/test/java/org/onap/portalng/bff/actions/ActionFixtures.java b/app/src/test/java/org/onap/portalng/bff/actions/ActionFixtures.java
index 0acd0eb..0ca28bf 100644
--- a/app/src/test/java/org/onap/portalng/bff/actions/ActionFixtures.java
+++ b/app/src/test/java/org/onap/portalng/bff/actions/ActionFixtures.java
@@ -23,27 +23,27 @@ package org.onap.portalng.bff.actions;
import java.time.OffsetDateTime;
import java.time.temporal.ChronoUnit;
-import org.onap.portalng.bff.openapi.client_portal_history.model.ActionResponsePortalHistoryDto;
-import org.onap.portalng.bff.openapi.client_portal_history.model.ActionsListResponsePortalHistoryDto;
-import org.onap.portalng.bff.openapi.client_portal_history.model.CreateActionRequestPortalHistoryDto;
+import org.onap.portalng.bff.openapi.client_history.model.ActionResponseHistoryDto;
+import org.onap.portalng.bff.openapi.client_history.model.ActionsListResponseHistoryDto;
+import org.onap.portalng.bff.openapi.client_history.model.CreateActionRequestHistoryDto;
import org.onap.portalng.bff.openapi.server.model.CreateActionRequestApiDto;
public class ActionFixtures {
- public static ActionsListResponsePortalHistoryDto generateActionsListResponse(
+ public static ActionsListResponseHistoryDto generateActionsListResponse(
Integer numberOfActions, Integer totalCount, OffsetDateTime createdAt) {
- ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto =
- new ActionsListResponsePortalHistoryDto();
+ ActionsListResponseHistoryDto actionsListResponseHistoryDto =
+ new ActionsListResponseHistoryDto();
for (Integer i = 0; i < numberOfActions; i++) {
- actionsListResponsePortalHistoryDto.addActionsListItem(
+ actionsListResponseHistoryDto.addActionsListItem(
generateActionResponse(
"Instantiation", "create", null, i.toString(), "SO", i, createdAt));
}
- actionsListResponsePortalHistoryDto.setTotalCount(totalCount);
- return actionsListResponsePortalHistoryDto;
+ actionsListResponseHistoryDto.setTotalCount(totalCount);
+ return actionsListResponseHistoryDto;
}
- public static ActionResponsePortalHistoryDto generateActionResponse(
+ public static ActionResponseHistoryDto generateActionResponse(
String type,
String action,
String message,
@@ -58,12 +58,12 @@ public class ActionFixtures {
actionDto.setDownStreamSystem(downStreamSystem);
actionDto.setDownStreamId(id);
- return new ActionResponsePortalHistoryDto()
+ return new ActionResponseHistoryDto()
.action(actionDto)
.actionCreatedAt(createdAt.minus(deltaHours, ChronoUnit.HOURS));
}
- public static CreateActionRequestPortalHistoryDto generateActionRequestPortalHistoryDto(
+ public static CreateActionRequestHistoryDto generateActionRequestHistoryDto(
String type,
String action,
String message,
@@ -77,7 +77,7 @@ public class ActionFixtures {
actionDto.setMessage(message);
actionDto.setDownStreamSystem(downStreamSystem);
actionDto.setDownStreamId(id);
- return new CreateActionRequestPortalHistoryDto()
+ return new CreateActionRequestHistoryDto()
.action(actionDto)
.actionCreatedAt(createdAt)
.userId(userId);
diff --git a/app/src/test/java/org/onap/portalng/bff/actions/ActionsMocks.java b/app/src/test/java/org/onap/portalng/bff/actions/ActionsMocks.java
index aa9e2f3..39fc3dc 100644
--- a/app/src/test/java/org/onap/portalng/bff/actions/ActionsMocks.java
+++ b/app/src/test/java/org/onap/portalng/bff/actions/ActionsMocks.java
@@ -27,9 +27,9 @@ import com.github.tomakehurst.wiremock.matching.EqualToPattern;
import io.restassured.http.Header;
import org.apache.http.HttpHeaders;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_history.model.ActionResponsePortalHistoryDto;
-import org.onap.portalng.bff.openapi.client_portal_history.model.ActionsListResponsePortalHistoryDto;
-import org.onap.portalng.bff.openapi.client_portal_history.model.ProblemPortalHistoryDto;
+import org.onap.portalng.bff.openapi.client_history.model.ActionResponseHistoryDto;
+import org.onap.portalng.bff.openapi.client_history.model.ActionsListResponseHistoryDto;
+import org.onap.portalng.bff.openapi.client_history.model.ProblemHistoryDto;
import org.onap.portalng.bff.openapi.server.model.ActionsListResponseApiDto;
import org.onap.portalng.bff.openapi.server.model.ActionsResponseApiDto;
import org.onap.portalng.bff.openapi.server.model.CreateActionRequestApiDto;
@@ -56,16 +56,15 @@ public class ActionsMocks extends BaseIntegrationTest {
}
// used for test thatActionsListCanBeRetrieved
- protected void mockListActions(
- ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto) throws Exception {
+ protected void mockListActions(ActionsListResponseHistoryDto actionsListResponseHistoryDto)
+ throws Exception {
WireMock.stubFor(
WireMock.get(WireMock.urlEqualTo("/v1/actions?page=1&pageSize=10"))
.withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID))
.willReturn(
WireMock.aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
- .withBody(
- objectMapper.writeValueAsString(actionsListResponsePortalHistoryDto))));
+ .withBody(objectMapper.writeValueAsString(actionsListResponseHistoryDto))));
}
// used for test thatActionsListCanNotBeRetrieved
@@ -84,8 +83,7 @@ public class ActionsMocks extends BaseIntegrationTest {
}
// used for test thatActionsListCanNotBeRetrieved
- protected void mockListActionsProblem(ProblemPortalHistoryDto problemPortalHistoryDto)
- throws Exception {
+ protected void mockListActionsProblem(ProblemHistoryDto problemHistoryDto) throws Exception {
WireMock.stubFor(
WireMock.get(WireMock.urlEqualTo("/v1/actions?page=1&pageSize=10"))
.withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID))
@@ -93,12 +91,12 @@ public class ActionsMocks extends BaseIntegrationTest {
WireMock.aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_PROBLEM_JSON_VALUE)
.withStatus(HttpStatus.INTERNAL_SERVER_ERROR.value())
- .withBody(objectMapper.writeValueAsString(problemPortalHistoryDto))));
+ .withBody(objectMapper.writeValueAsString(problemHistoryDto))));
}
// used for test thatActionCanBeRetrieved
protected void mockGetActions(
- ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto,
+ ActionsListResponseHistoryDto actionsListResponseHistoryDto,
String userId,
Integer showLastHours)
throws Exception {
@@ -114,8 +112,7 @@ public class ActionsMocks extends BaseIntegrationTest {
.willReturn(
WireMock.aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
- .withBody(
- objectMapper.writeValueAsString(actionsListResponsePortalHistoryDto))));
+ .withBody(objectMapper.writeValueAsString(actionsListResponseHistoryDto))));
}
// used for test thatActionCanBeRetrieved
protected ActionsListResponseApiDto getActions(String userId) {
@@ -134,16 +131,14 @@ public class ActionsMocks extends BaseIntegrationTest {
// used for test thatActionCanBeRetrievedWithoutParameterShowLastHours
protected void mockGetActionsWithoutParameterShowLastHours(
- ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto, String userId)
- throws Exception {
+ ActionsListResponseHistoryDto actionsListResponseHistoryDto, String userId) throws Exception {
WireMock.stubFor(
WireMock.get(WireMock.urlEqualTo("/v1/actions/" + userId + "?page=1&pageSize=10"))
.withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID))
.willReturn(
WireMock.aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
- .withBody(
- objectMapper.writeValueAsString(actionsListResponsePortalHistoryDto))));
+ .withBody(objectMapper.writeValueAsString(actionsListResponseHistoryDto))));
}
// used for test thatActionCanBeRetrievedWithoutParameterShowLastHours
protected ActionsListResponseApiDto getActionsWithoutParameterShowLastHours(String userId) {
@@ -161,8 +156,7 @@ public class ActionsMocks extends BaseIntegrationTest {
}
// Used for thatActionCanBeCreated
- protected void mockCreateActions(
- String userId, ActionResponsePortalHistoryDto actionResponsePortalHistoryDto)
+ protected void mockCreateActions(String userId, ActionResponseHistoryDto actionResponseHistoryDto)
throws Exception {
WireMock.stubFor(
WireMock.post(WireMock.urlEqualTo("/v1/actions/" + userId))
@@ -172,7 +166,7 @@ public class ActionsMocks extends BaseIntegrationTest {
WireMock.aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.withStatus(200)
- .withBody(objectMapper.writeValueAsString(actionResponsePortalHistoryDto))));
+ .withBody(objectMapper.writeValueAsString(actionResponseHistoryDto))));
}
// Used for thatActionCanBeCreated
@@ -194,8 +188,7 @@ public class ActionsMocks extends BaseIntegrationTest {
}
// Used for thatActionCanNotBeCreated
- protected void mockCreateActionsProblem(
- String userId, ProblemPortalHistoryDto problemPortalHistoryDto)
+ protected void mockCreateActionsProblem(String userId, ProblemHistoryDto problemHistoryDto)
throws JsonProcessingException {
WireMock.stubFor(
WireMock.post(WireMock.urlEqualTo("/v1/actions/" + userId))
@@ -205,7 +198,7 @@ public class ActionsMocks extends BaseIntegrationTest {
WireMock.aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_PROBLEM_JSON_VALUE)
.withStatus(500)
- .withBody(objectMapper.writeValueAsString(problemPortalHistoryDto))));
+ .withBody(objectMapper.writeValueAsString(problemHistoryDto))));
}
// Used for thatActionCanNotBeCreated
protected ProblemApiDto createActionProblem(
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 3508f19..748d568 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
@@ -26,8 +26,8 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.time.OffsetDateTime;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
-import org.onap.portalng.bff.openapi.client_portal_history.model.ActionResponsePortalHistoryDto;
-import org.onap.portalng.bff.openapi.client_portal_history.model.ProblemPortalHistoryDto;
+import org.onap.portalng.bff.openapi.client_history.model.ActionResponseHistoryDto;
+import org.onap.portalng.bff.openapi.client_history.model.ProblemHistoryDto;
import org.onap.portalng.bff.openapi.server.model.ActionsResponseApiDto;
import org.onap.portalng.bff.openapi.server.model.CreateActionRequestApiDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
@@ -39,21 +39,21 @@ class CreateActionsIntegrationTest extends ActionsMocks {
void thatActionCanBeCreated() throws Exception {
String userId = "22-33-44-55";
OffsetDateTime createdAt = OffsetDateTime.now();
- ActionResponsePortalHistoryDto actionResponsePortalHistoryDto =
+ ActionResponseHistoryDto actionResponseHistoryDto =
ActionFixtures.generateActionResponse(
"Instantiation", "create", "no detail message", "223344", "SO", 0, createdAt);
CreateActionRequestApiDto createActionDto =
ActionFixtures.generateCreateActionRequestApiDto(
"Instantiation", "create", "no detail message", "223344", "SO", userId, createdAt);
- mockCreateActions(userId, actionResponsePortalHistoryDto);
+ mockCreateActions(userId, actionResponseHistoryDto);
final ActionsResponseApiDto response = createAction(createActionDto, userId);
assertThat(response.getActionCreatedAt())
- .isEqualTo(actionResponsePortalHistoryDto.getActionCreatedAt());
+ .isEqualTo(actionResponseHistoryDto.getActionCreatedAt());
Assertions.assertThat(objectMapper.writeValueAsString(response.getAction()))
- .isEqualTo(objectMapper.writeValueAsString(actionResponsePortalHistoryDto.getAction()));
+ .isEqualTo(objectMapper.writeValueAsString(actionResponseHistoryDto.getAction()));
}
@Test
@@ -61,18 +61,18 @@ class CreateActionsIntegrationTest extends ActionsMocks {
String userId = "22-33-44-55";
OffsetDateTime createdAt = OffsetDateTime.now();
- ProblemPortalHistoryDto problemPortalHistoryDto =
- new ProblemPortalHistoryDto()
+ ProblemHistoryDto problemHistoryDto =
+ new ProblemHistoryDto()
.status(HttpStatus.INTERNAL_SERVER_ERROR.value())
.detail("Internal database error")
.title("Internal Server Error")
- .instance("portal-history");
+ .instance("history");
CreateActionRequestApiDto createActionDto =
ActionFixtures.generateCreateActionRequestApiDto(
"Instantiation", "create", "no detail message", "223344", "SO", userId, createdAt);
- mockCreateActionsProblem(userId, problemPortalHistoryDto);
+ mockCreateActionsProblem(userId, problemHistoryDto);
final ProblemApiDto response = createActionProblem(createActionDto, userId);
@@ -80,6 +80,6 @@ class CreateActionsIntegrationTest extends ActionsMocks {
.isEqualTo(ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY);
assertThat(response.getDownstreamStatus()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value());
- assertThat(response.getDetail()).isEqualTo(problemPortalHistoryDto.getDetail());
+ assertThat(response.getDetail()).isEqualTo(problemHistoryDto.getDetail());
}
}
diff --git a/app/src/test/java/org/onap/portalng/bff/actions/GetActionsIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/actions/GetActionsIntegrationTest.java
index 489a8d3..90c065e 100644
--- a/app/src/test/java/org/onap/portalng/bff/actions/GetActionsIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/actions/GetActionsIntegrationTest.java
@@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Test;
-import org.onap.portalng.bff.openapi.client_portal_history.model.ActionsListResponsePortalHistoryDto;
+import org.onap.portalng.bff.openapi.client_history.model.ActionsListResponseHistoryDto;
import org.onap.portalng.bff.openapi.server.model.ActionsListResponseApiDto;
class GetActionsIntegrationTest extends ActionsMocks {
@@ -36,22 +36,21 @@ class GetActionsIntegrationTest extends ActionsMocks {
Integer showLastHours = 2;
String userId = "22-33-44-55";
OffsetDateTime createdAt = OffsetDateTime.now();
- ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto =
+ ActionsListResponseHistoryDto actionsListResponseHistoryDto =
ActionFixtures.generateActionsListResponse(numberOfActions, 30, createdAt);
- mockGetActions(actionsListResponsePortalHistoryDto, userId, showLastHours);
+ mockGetActions(actionsListResponseHistoryDto, userId, showLastHours);
final ActionsListResponseApiDto response = getActions(userId);
assertThat(response.getTotalCount()).isEqualTo(30);
assertThat(response.getItems()).hasSize(numberOfActions);
assertThat(response.getItems().get(0).getActionCreatedAt())
- .isEqualTo(
- actionsListResponsePortalHistoryDto.getActionsList().get(0).getActionCreatedAt());
+ .isEqualTo(actionsListResponseHistoryDto.getActionsList().get(0).getActionCreatedAt());
assertThat(objectMapper.writeValueAsString(response.getItems().get(0).getAction()))
.isEqualTo(
objectMapper.writeValueAsString(
- actionsListResponsePortalHistoryDto.getActionsList().get(0).getAction()));
+ actionsListResponseHistoryDto.getActionsList().get(0).getAction()));
}
@Test
@@ -59,21 +58,20 @@ class GetActionsIntegrationTest extends ActionsMocks {
int numberOfActions = 10;
String userId = "22-33-44-55";
OffsetDateTime createdAt = OffsetDateTime.now();
- ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto =
+ ActionsListResponseHistoryDto actionsListResponseHistoryDto =
ActionFixtures.generateActionsListResponse(numberOfActions, 30, createdAt);
- mockGetActionsWithoutParameterShowLastHours(actionsListResponsePortalHistoryDto, userId);
+ mockGetActionsWithoutParameterShowLastHours(actionsListResponseHistoryDto, userId);
final ActionsListResponseApiDto response = getActionsWithoutParameterShowLastHours(userId);
assertThat(response.getTotalCount()).isEqualTo(30);
assertThat(response.getItems()).hasSize(numberOfActions);
assertThat(response.getItems().get(0).getActionCreatedAt())
- .isEqualTo(
- actionsListResponsePortalHistoryDto.getActionsList().get(0).getActionCreatedAt());
+ .isEqualTo(actionsListResponseHistoryDto.getActionsList().get(0).getActionCreatedAt());
assertThat(objectMapper.writeValueAsString(response.getItems().get(0).getAction()))
.isEqualTo(
objectMapper.writeValueAsString(
- actionsListResponsePortalHistoryDto.getActionsList().get(0).getAction()));
+ actionsListResponseHistoryDto.getActionsList().get(0).getAction()));
}
}
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 8451641..5acc4f4 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
@@ -26,8 +26,8 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.time.OffsetDateTime;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
-import org.onap.portalng.bff.openapi.client_portal_history.model.ActionsListResponsePortalHistoryDto;
-import org.onap.portalng.bff.openapi.client_portal_history.model.ProblemPortalHistoryDto;
+import org.onap.portalng.bff.openapi.client_history.model.ActionsListResponseHistoryDto;
+import org.onap.portalng.bff.openapi.client_history.model.ProblemHistoryDto;
import org.onap.portalng.bff.openapi.server.model.ActionsListResponseApiDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
import org.springframework.http.HttpStatus;
@@ -38,41 +38,40 @@ class ListActionsIntegrationTest extends ActionsMocks {
void thatActionsListCanBeRetrieved() throws Exception {
int numberOfActions = 10;
OffsetDateTime createdAt = OffsetDateTime.now();
- ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto =
+ ActionsListResponseHistoryDto actionsListResponseHistoryDto =
ActionFixtures.generateActionsListResponse(numberOfActions, 1000, createdAt);
- mockListActions(actionsListResponsePortalHistoryDto);
+ mockListActions(actionsListResponseHistoryDto);
final ActionsListResponseApiDto response = listActions();
assertThat(response.getTotalCount()).isEqualTo(1000);
assertThat(response.getItems()).hasSize(numberOfActions);
assertThat(response.getItems().get(0).getActionCreatedAt())
- .isEqualTo(
- actionsListResponsePortalHistoryDto.getActionsList().get(0).getActionCreatedAt());
+ .isEqualTo(actionsListResponseHistoryDto.getActionsList().get(0).getActionCreatedAt());
Assertions.assertThat(objectMapper.writeValueAsString(response.getItems().get(0).getAction()))
.isEqualTo(
objectMapper.writeValueAsString(
- actionsListResponsePortalHistoryDto.getActionsList().get(0).getAction()));
+ actionsListResponseHistoryDto.getActionsList().get(0).getAction()));
}
@Test
void thatActionsListCanNotBeRetrieved() throws Exception {
- ProblemPortalHistoryDto problemPortalHistoryDto =
- new ProblemPortalHistoryDto()
+ ProblemHistoryDto problemHistoryDto =
+ new ProblemHistoryDto()
.status(HttpStatus.INTERNAL_SERVER_ERROR.value())
.detail("Internal database error")
.title("Internal Server Error")
- .instance("portal-history");
+ .instance("history");
- mockListActionsProblem(problemPortalHistoryDto);
+ mockListActionsProblem(problemHistoryDto);
final ProblemApiDto response = listActionsProblem();
assertThat(response.getDownstreamSystem())
.isEqualTo(ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY);
assertThat(response.getDownstreamStatus()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value());
- assertThat(response.getDetail()).isEqualTo(problemPortalHistoryDto.getDetail());
+ assertThat(response.getDetail()).isEqualTo(problemHistoryDto.getDetail());
}
}
diff --git a/app/src/test/java/org/onap/portalng/bff/headers/XRequestIdHeaderTest.java b/app/src/test/java/org/onap/portalng/bff/headers/XRequestIdHeaderTest.java
index 6f82308..b79537c 100644
--- a/app/src/test/java/org/onap/portalng/bff/headers/XRequestIdHeaderTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/headers/XRequestIdHeaderTest.java
@@ -28,7 +28,7 @@ import com.github.tomakehurst.wiremock.matching.EqualToPattern;
import io.restassured.http.Header;
import org.junit.jupiter.api.Test;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_prefs.model.PreferencesPortalPrefsDto;
+import org.onap.portalng.bff.openapi.client_preferences.model.PreferencesPreferencesDto;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@@ -39,17 +39,17 @@ class XRequestIdHeaderTest extends BaseIntegrationTest {
@Test
void xRequestIdHeaderIsCorrectlySetInResponse() throws Exception {
// use preferences endpoint for testing the header
- final PreferencesPortalPrefsDto preferencesPortalPrefsDto = new PreferencesPortalPrefsDto();
+ final PreferencesPreferencesDto preferencesPreferencesDto = new PreferencesPreferencesDto();
// mockGetTile(tileDetailResponsePortalServiceDto, X_REQUEST_ID);
- mockGetPreferences(preferencesPortalPrefsDto, X_REQUEST_ID);
+ mockGetPreferences(preferencesPreferencesDto, X_REQUEST_ID);
final String response = getPreferencesExtractHeader(X_REQUEST_ID);
assertThat(response).isEqualTo(X_REQUEST_ID);
}
protected void mockGetPreferences(
- PreferencesPortalPrefsDto preferencesPortalPrefsDto, String xRequestId) throws Exception {
+ PreferencesPreferencesDto preferencesPreferencesDto, String xRequestId) throws Exception {
WireMock.stubFor(
WireMock.get(WireMock.urlEqualTo("/v1/preferences"))
.withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID))
@@ -57,7 +57,7 @@ class XRequestIdHeaderTest extends BaseIntegrationTest {
WireMock.aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.withHeader("X-Request-Id", xRequestId)
- .withBody(objectMapper.writeValueAsString(preferencesPortalPrefsDto))));
+ .withBody(objectMapper.writeValueAsString(preferencesPreferencesDto))));
}
protected String getPreferencesExtractHeader(String xRequestId) {
diff --git a/app/src/test/java/org/onap/portalng/bff/preferences/CreatePreferencesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/preferences/CreatePreferencesIntegrationTest.java
index 65a6f19..3b16664 100644
--- a/app/src/test/java/org/onap/portalng/bff/preferences/CreatePreferencesIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/preferences/CreatePreferencesIntegrationTest.java
@@ -25,8 +25,8 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import io.restassured.http.Header;
import org.junit.jupiter.api.Test;
-import org.onap.portalng.bff.openapi.client_portal_prefs.model.PreferencesPortalPrefsDto;
-import org.onap.portalng.bff.openapi.client_portal_prefs.model.ProblemPortalPrefsDto;
+import org.onap.portalng.bff.openapi.client_preferences.model.PreferencesPreferencesDto;
+import org.onap.portalng.bff.openapi.client_preferences.model.ProblemPreferencesDto;
import org.onap.portalng.bff.openapi.server.model.CreatePreferencesRequestApiDto;
import org.onap.portalng.bff.openapi.server.model.PreferencesResponseApiDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
@@ -36,8 +36,8 @@ import org.springframework.http.MediaType;
class CreatePreferencesIntegrationTest extends PreferencesMocks {
@Test
void thatPreferencesCanBeCreated() throws Exception {
- PreferencesPortalPrefsDto preferencesPortalPrefsDto = new PreferencesPortalPrefsDto();
- preferencesPortalPrefsDto.setProperties(
+ PreferencesPreferencesDto preferencesPreferencesDto = new PreferencesPreferencesDto();
+ preferencesPreferencesDto.setProperties(
"{\n"
+ "\"properties\": {\n"
+ "\"appStarter\": \"value1\",\n"
@@ -45,7 +45,7 @@ class CreatePreferencesIntegrationTest extends PreferencesMocks {
+ "}\n"
+ "\n"
+ "}");
- mockCreatePreferences(preferencesPortalPrefsDto);
+ mockCreatePreferences(preferencesPreferencesDto);
final CreatePreferencesRequestApiDto request =
new CreatePreferencesRequestApiDto()
@@ -59,18 +59,18 @@ class CreatePreferencesIntegrationTest extends PreferencesMocks {
+ "}");
final PreferencesResponseApiDto response = createPreferences(request);
assertThat(response).isNotNull();
- assertThat(response.getProperties()).isEqualTo(preferencesPortalPrefsDto.getProperties());
+ assertThat(response.getProperties()).isEqualTo(preferencesPreferencesDto.getProperties());
}
@Test
void thatPreferencesCanNotBeCreated() throws Exception {
- final var problemPortalPrefsDto = new ProblemPortalPrefsDto();
- problemPortalPrefsDto.setStatus(HttpStatus.BAD_REQUEST.value());
- problemPortalPrefsDto.setTitle(HttpStatus.BAD_REQUEST.toString());
- problemPortalPrefsDto.setDetail("Some details");
+ final var problemPreferencesDto = new ProblemPreferencesDto();
+ problemPreferencesDto.setStatus(HttpStatus.BAD_REQUEST.value());
+ problemPreferencesDto.setTitle(HttpStatus.BAD_REQUEST.toString());
+ problemPreferencesDto.setDetail("Some details");
- final PreferencesPortalPrefsDto preferencesPortalPrefsDto =
- new PreferencesPortalPrefsDto()
+ final PreferencesPreferencesDto preferencesPreferencesDto =
+ new PreferencesPreferencesDto()
.properties(
"{\n"
+ "\"properties\": {\n"
@@ -79,7 +79,7 @@ class CreatePreferencesIntegrationTest extends PreferencesMocks {
+ "}\n"
+ "\n"
+ "}");
- mockCreatePreferencesError(preferencesPortalPrefsDto, problemPortalPrefsDto);
+ mockCreatePreferencesError(preferencesPreferencesDto, problemPreferencesDto);
CreatePreferencesRequestApiDto responseBody =
new CreatePreferencesRequestApiDto()
@@ -107,9 +107,9 @@ class CreatePreferencesIntegrationTest extends PreferencesMocks {
.as(ProblemApiDto.class);
assertThat(response.getStatus()).isEqualTo(HttpStatus.BAD_GATEWAY.value());
- assertThat(response.getDetail()).isEqualTo(problemPortalPrefsDto.getDetail());
+ assertThat(response.getDetail()).isEqualTo(problemPreferencesDto.getDetail());
assertThat(response.getDownstreamSystem())
- .isEqualTo(ProblemApiDto.DownstreamSystemEnum.PORTAL_PREFS);
+ .isEqualTo(ProblemApiDto.DownstreamSystemEnum.PREFERENCES);
assertThat(response.getDownstreamStatus()).isEqualTo(HttpStatus.BAD_REQUEST.value());
}
}
diff --git a/app/src/test/java/org/onap/portalng/bff/preferences/GetPreferencesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/preferences/GetPreferencesIntegrationTest.java
index 06329d4..a88a0cd 100644
--- a/app/src/test/java/org/onap/portalng/bff/preferences/GetPreferencesIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/preferences/GetPreferencesIntegrationTest.java
@@ -25,8 +25,8 @@ import static org.assertj.core.api.Assertions.assertThat;
import io.restassured.http.Header;
import org.junit.jupiter.api.Test;
-import org.onap.portalng.bff.openapi.client_portal_prefs.model.PreferencesPortalPrefsDto;
-import org.onap.portalng.bff.openapi.client_portal_prefs.model.ProblemPortalPrefsDto;
+import org.onap.portalng.bff.openapi.client_preferences.model.PreferencesPreferencesDto;
+import org.onap.portalng.bff.openapi.client_preferences.model.ProblemPreferencesDto;
import org.onap.portalng.bff.openapi.server.model.PreferencesResponseApiDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
import org.springframework.http.HttpStatus;
@@ -36,9 +36,9 @@ class GetPreferencesIntegrationTest extends PreferencesMocks {
@Test
void thatPreferencesCanBeRetrieved() throws Exception {
- PreferencesPortalPrefsDto preferencesPortalPrefsDto = new PreferencesPortalPrefsDto();
- preferencesPortalPrefsDto.setProperties(getFixture(PREF_PROPERTIES_FILE, Object.class));
- mockGetPreferences(preferencesPortalPrefsDto);
+ PreferencesPreferencesDto preferencesPreferencesDto = new PreferencesPreferencesDto();
+ preferencesPreferencesDto.setProperties(getFixture(PREF_PROPERTIES_FILE, Object.class));
+ mockGetPreferences(preferencesPreferencesDto);
final PreferencesResponseApiDto response = getPreferences();
assertThat(response).isNotNull();
@@ -46,8 +46,8 @@ class GetPreferencesIntegrationTest extends PreferencesMocks {
@Test
void thatPreferencesCanNotBeRetrieved() throws Exception {
- final ProblemPortalPrefsDto problemResponse =
- new ProblemPortalPrefsDto()
+ final ProblemPreferencesDto problemResponse =
+ new ProblemPreferencesDto()
.title("Unauthorized")
.status(HttpStatus.UNAUTHORIZED.value())
.detail("Unauthorized error detail")
diff --git a/app/src/test/java/org/onap/portalng/bff/preferences/PreferencesMocks.java b/app/src/test/java/org/onap/portalng/bff/preferences/PreferencesMocks.java
index 0d5b69a..9c5be75 100644
--- a/app/src/test/java/org/onap/portalng/bff/preferences/PreferencesMocks.java
+++ b/app/src/test/java/org/onap/portalng/bff/preferences/PreferencesMocks.java
@@ -30,8 +30,8 @@ import java.io.File;
import java.io.IOException;
import org.apache.http.HttpHeaders;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_prefs.model.PreferencesPortalPrefsDto;
-import org.onap.portalng.bff.openapi.client_portal_prefs.model.ProblemPortalPrefsDto;
+import org.onap.portalng.bff.openapi.client_preferences.model.PreferencesPreferencesDto;
+import org.onap.portalng.bff.openapi.client_preferences.model.ProblemPreferencesDto;
import org.onap.portalng.bff.openapi.server.model.CreatePreferencesRequestApiDto;
import org.onap.portalng.bff.openapi.server.model.PreferencesResponseApiDto;
import org.springframework.http.HttpStatus;
@@ -65,7 +65,7 @@ public class PreferencesMocks extends BaseIntegrationTest {
.as(PreferencesResponseApiDto.class);
}
- protected void mockGetPreferences(PreferencesPortalPrefsDto preferencesPortalPrefsDto)
+ protected void mockGetPreferences(PreferencesPreferencesDto preferencesPreferencesDto)
throws Exception {
WireMock.stubFor(
WireMock.get(WireMock.urlEqualTo("/v1/preferences"))
@@ -73,10 +73,10 @@ public class PreferencesMocks extends BaseIntegrationTest {
.willReturn(
WireMock.aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
- .withBody(objectMapper.writeValueAsString(preferencesPortalPrefsDto))));
+ .withBody(objectMapper.writeValueAsString(preferencesPreferencesDto))));
}
- protected void mockGetPreferencesError(ProblemPortalPrefsDto problem) throws Exception {
+ protected void mockGetPreferencesError(ProblemPreferencesDto problem) throws Exception {
WireMock.stubFor(
WireMock.get(WireMock.urlEqualTo("/v1/preferences"))
.withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID))
@@ -104,35 +104,35 @@ public class PreferencesMocks extends BaseIntegrationTest {
.as(PreferencesResponseApiDto.class);
}
- protected void mockCreatePreferences(PreferencesPortalPrefsDto preferencesPortalPrefsDto)
+ protected void mockCreatePreferences(PreferencesPreferencesDto preferencesPreferencesDto)
throws Exception {
WireMock.stubFor(
WireMock.post(WireMock.urlEqualTo("/v1/preferences"))
.withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID))
.withRequestBody(
WireMock.equalToJson(
- objectMapper.writeValueAsString(preferencesPortalPrefsDto), true, false))
+ objectMapper.writeValueAsString(preferencesPreferencesDto), true, false))
.willReturn(
WireMock.aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
- .withBody(objectMapper.writeValueAsString(preferencesPortalPrefsDto))));
+ .withBody(objectMapper.writeValueAsString(preferencesPreferencesDto))));
}
protected void mockCreatePreferencesError(
- PreferencesPortalPrefsDto preferencesPortalPrefsDto,
- ProblemPortalPrefsDto problemPortalPrefsDto)
+ PreferencesPreferencesDto preferencesPreferencesDto,
+ ProblemPreferencesDto problemPreferencesDto)
throws Exception {
WireMock.stubFor(
WireMock.post(WireMock.urlEqualTo("/v1/preferences"))
.withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID))
.withRequestBody(
WireMock.equalToJson(
- objectMapper.writeValueAsString(preferencesPortalPrefsDto), true, false))
+ objectMapper.writeValueAsString(preferencesPreferencesDto), true, false))
.willReturn(
WireMock.aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.withStatus(HttpStatus.BAD_REQUEST.value())
- .withBody(objectMapper.writeValueAsString(problemPortalPrefsDto))));
+ .withBody(objectMapper.writeValueAsString(problemPreferencesDto))));
}
protected PreferencesResponseApiDto updatePreferences(CreatePreferencesRequestApiDto request) {
@@ -150,33 +150,33 @@ public class PreferencesMocks extends BaseIntegrationTest {
.as(PreferencesResponseApiDto.class);
}
- protected void mockUpdatePreferences(PreferencesPortalPrefsDto preferencesPortalPrefsDto)
+ protected void mockUpdatePreferences(PreferencesPreferencesDto preferencesPreferencesDto)
throws Exception {
WireMock.stubFor(
WireMock.put(WireMock.urlEqualTo("/v1/preferences"))
.withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID))
.withRequestBody(
WireMock.equalToJson(
- objectMapper.writeValueAsString(preferencesPortalPrefsDto), true, false))
+ objectMapper.writeValueAsString(preferencesPreferencesDto), true, false))
.willReturn(
WireMock.aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
- .withBody(objectMapper.writeValueAsString(preferencesPortalPrefsDto))));
+ .withBody(objectMapper.writeValueAsString(preferencesPreferencesDto))));
}
protected void mockUpdatePreferencesError(
- PreferencesPortalPrefsDto preferencesPortalPrefsDto,
- ProblemPortalPrefsDto problemPortalPrefsDto)
+ PreferencesPreferencesDto preferencesPreferencesDto,
+ ProblemPreferencesDto problemPreferencesDto)
throws Exception {
WireMock.stubFor(
WireMock.put(WireMock.urlEqualTo("/v1/preferences"))
.withRequestBody(
WireMock.equalToJson(
- objectMapper.writeValueAsString(preferencesPortalPrefsDto), true, false))
+ objectMapper.writeValueAsString(preferencesPreferencesDto), true, false))
.willReturn(
WireMock.aResponse()
.withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.withStatus(HttpStatus.BAD_REQUEST.value())
- .withBody(objectMapper.writeValueAsString(problemPortalPrefsDto))));
+ .withBody(objectMapper.writeValueAsString(problemPreferencesDto))));
}
}
diff --git a/app/src/test/java/org/onap/portalng/bff/preferences/UpdatePreferencesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/preferences/UpdatePreferencesIntegrationTest.java
index 031726e..1cd9a70 100644
--- a/app/src/test/java/org/onap/portalng/bff/preferences/UpdatePreferencesIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/preferences/UpdatePreferencesIntegrationTest.java
@@ -25,8 +25,8 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import io.restassured.http.Header;
import org.junit.jupiter.api.Test;
-import org.onap.portalng.bff.openapi.client_portal_prefs.model.PreferencesPortalPrefsDto;
-import org.onap.portalng.bff.openapi.client_portal_prefs.model.ProblemPortalPrefsDto;
+import org.onap.portalng.bff.openapi.client_preferences.model.PreferencesPreferencesDto;
+import org.onap.portalng.bff.openapi.client_preferences.model.ProblemPreferencesDto;
import org.onap.portalng.bff.openapi.server.model.CreatePreferencesRequestApiDto;
import org.onap.portalng.bff.openapi.server.model.PreferencesResponseApiDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
@@ -36,8 +36,8 @@ import org.springframework.http.MediaType;
class UpdatePreferencesIntegrationTest extends PreferencesMocks {
@Test
void thatPreferencesCanBeUpdated() throws Exception {
- PreferencesPortalPrefsDto preferencesPortalPrefsDto = new PreferencesPortalPrefsDto();
- preferencesPortalPrefsDto.setProperties(
+ PreferencesPreferencesDto preferencesPreferencesDto = new PreferencesPreferencesDto();
+ preferencesPreferencesDto.setProperties(
"{\n"
+ "\"properties\": {\n"
+ "\"appStarter\": \"value1\",\n"
@@ -45,7 +45,7 @@ class UpdatePreferencesIntegrationTest extends PreferencesMocks {
+ "}\n"
+ "\n"
+ "}");
- mockUpdatePreferences(preferencesPortalPrefsDto);
+ mockUpdatePreferences(preferencesPreferencesDto);
final CreatePreferencesRequestApiDto requestApiDto =
new CreatePreferencesRequestApiDto()
@@ -59,18 +59,18 @@ class UpdatePreferencesIntegrationTest extends PreferencesMocks {
+ "}");
final PreferencesResponseApiDto response = updatePreferences(requestApiDto);
assertThat(response).isNotNull();
- assertThat(response.getProperties()).isEqualTo(preferencesPortalPrefsDto.getProperties());
+ assertThat(response.getProperties()).isEqualTo(preferencesPreferencesDto.getProperties());
}
@Test
void thatPreferencesCanNotBeUpdated() throws Exception {
- final var problemPortalPrefsDto = new ProblemPortalPrefsDto();
- problemPortalPrefsDto.setStatus(HttpStatus.BAD_REQUEST.value());
- problemPortalPrefsDto.setTitle(HttpStatus.BAD_REQUEST.toString());
- problemPortalPrefsDto.setDetail("Some details");
+ final var problemPreferencesDto = new ProblemPreferencesDto();
+ problemPreferencesDto.setStatus(HttpStatus.BAD_REQUEST.value());
+ problemPreferencesDto.setTitle(HttpStatus.BAD_REQUEST.toString());
+ problemPreferencesDto.setDetail("Some details");
- final PreferencesPortalPrefsDto preferencesPortalPrefsDto =
- new PreferencesPortalPrefsDto()
+ final PreferencesPreferencesDto preferencesPreferencesDto =
+ new PreferencesPreferencesDto()
.properties(
"{\n"
+ "\"properties\": {\n"
@@ -79,7 +79,7 @@ class UpdatePreferencesIntegrationTest extends PreferencesMocks {
+ "}\n"
+ "\n"
+ "}");
- mockUpdatePreferencesError(preferencesPortalPrefsDto, problemPortalPrefsDto);
+ mockUpdatePreferencesError(preferencesPreferencesDto, problemPreferencesDto);
CreatePreferencesRequestApiDto requestApiDto =
new CreatePreferencesRequestApiDto()
@@ -108,7 +108,7 @@ class UpdatePreferencesIntegrationTest extends PreferencesMocks {
assertThat(response.getStatus()).isEqualTo(HttpStatus.BAD_GATEWAY.value());
assertThat(response.getDownstreamSystem())
- .isEqualTo(ProblemApiDto.DownstreamSystemEnum.PORTAL_PREFS);
+ .isEqualTo(ProblemApiDto.DownstreamSystemEnum.PREFERENCES);
assertThat(response.getDownstreamStatus()).isEqualTo(HttpStatus.BAD_REQUEST.value());
}
}
diff --git a/app/src/test/java/org/onap/portalng/bff/roles/ListRealmRolesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/roles/ListRealmRolesIntegrationTest.java
index df95e2c..d9a69f1 100644
--- a/app/src/test/java/org/onap/portalng/bff/roles/ListRealmRolesIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/roles/ListRealmRolesIntegrationTest.java
@@ -27,8 +27,8 @@ import com.github.tomakehurst.wiremock.client.WireMock;
import io.restassured.http.Header;
import java.util.List;
import org.junit.jupiter.api.Test;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
import org.onap.portalng.bff.openapi.server.model.RoleApiDto;
import org.onap.portalng.bff.openapi.server.model.RoleListResponseApiDto;
diff --git a/app/src/test/java/org/onap/portalng/bff/roles/RolesMocks.java b/app/src/test/java/org/onap/portalng/bff/roles/RolesMocks.java
index fe065a7..b29ad7c 100644
--- a/app/src/test/java/org/onap/portalng/bff/roles/RolesMocks.java
+++ b/app/src/test/java/org/onap/portalng/bff/roles/RolesMocks.java
@@ -25,7 +25,7 @@ import com.github.tomakehurst.wiremock.client.WireMock;
import io.restassured.http.Header;
import java.util.List;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto;
import org.onap.portalng.bff.openapi.server.model.RoleListResponseApiDto;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
diff --git a/app/src/test/java/org/onap/portalng/bff/users/CreateUserIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/CreateUserIntegrationTest.java
index aa67631..5aab69d 100644
--- a/app/src/test/java/org/onap/portalng/bff/users/CreateUserIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/users/CreateUserIntegrationTest.java
@@ -30,10 +30,10 @@ import java.util.Collections;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RequiredActionsKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.UserKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.RequiredActionsKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.UserKeycloakDto;
import org.onap.portalng.bff.openapi.server.model.CreateUserRequestApiDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
import org.onap.portalng.bff.openapi.server.model.RoleApiDto;
diff --git a/app/src/test/java/org/onap/portalng/bff/users/DeleteUserIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/DeleteUserIntegrationTest.java
index 639e5d3..11076d4 100644
--- a/app/src/test/java/org/onap/portalng/bff/users/DeleteUserIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/users/DeleteUserIntegrationTest.java
@@ -27,7 +27,7 @@ import com.github.tomakehurst.wiremock.client.WireMock;
import io.restassured.http.Header;
import org.junit.jupiter.api.Test;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
diff --git a/app/src/test/java/org/onap/portalng/bff/users/GetUserDetailIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/GetUserDetailIntegrationTest.java
index 6704cbc..e334953 100644
--- a/app/src/test/java/org/onap/portalng/bff/users/GetUserDetailIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/users/GetUserDetailIntegrationTest.java
@@ -29,9 +29,9 @@ import io.restassured.http.Header;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.UserKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.UserKeycloakDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
import org.onap.portalng.bff.openapi.server.model.UserResponseApiDto;
import org.springframework.http.HttpHeaders;
diff --git a/app/src/test/java/org/onap/portalng/bff/users/ListAssignedRolesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/ListAssignedRolesIntegrationTest.java
index 7d05c67..7ab1130 100644
--- a/app/src/test/java/org/onap/portalng/bff/users/ListAssignedRolesIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/users/ListAssignedRolesIntegrationTest.java
@@ -28,8 +28,8 @@ import io.restassured.http.Header;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
import org.onap.portalng.bff.openapi.server.model.RoleApiDto;
import org.onap.portalng.bff.openapi.server.model.RoleListResponseApiDto;
diff --git a/app/src/test/java/org/onap/portalng/bff/users/ListAvailableRolesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/ListAvailableRolesIntegrationTest.java
index 86f9ed8..45290da 100644
--- a/app/src/test/java/org/onap/portalng/bff/users/ListAvailableRolesIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/users/ListAvailableRolesIntegrationTest.java
@@ -28,8 +28,8 @@ import io.restassured.http.Header;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
import org.onap.portalng.bff.openapi.server.model.RoleApiDto;
import org.onap.portalng.bff.openapi.server.model.RoleListResponseApiDto;
diff --git a/app/src/test/java/org/onap/portalng/bff/users/ListUsersIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/ListUsersIntegrationTest.java
index 27a8ecd..8e675ca 100644
--- a/app/src/test/java/org/onap/portalng/bff/users/ListUsersIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/users/ListUsersIntegrationTest.java
@@ -30,9 +30,9 @@ import java.util.List;
import java.util.Optional;
import org.junit.jupiter.api.Test;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.UserKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.UserKeycloakDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
import org.onap.portalng.bff.openapi.server.model.UserListResponseApiDto;
import org.onap.portalng.bff.openapi.server.model.UserResponseApiDto;
diff --git a/app/src/test/java/org/onap/portalng/bff/users/UpdateAssignedRolesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/UpdateAssignedRolesIntegrationTest.java
index a1a5ee3..8f7b350 100644
--- a/app/src/test/java/org/onap/portalng/bff/users/UpdateAssignedRolesIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/users/UpdateAssignedRolesIntegrationTest.java
@@ -30,8 +30,8 @@ import java.util.Collections;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
import org.onap.portalng.bff.openapi.server.model.RoleApiDto;
import org.onap.portalng.bff.openapi.server.model.RoleListResponseApiDto;
diff --git a/app/src/test/java/org/onap/portalng/bff/users/UpdateUserIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/UpdateUserIntegrationTest.java
index f181c5e..0cce10a 100644
--- a/app/src/test/java/org/onap/portalng/bff/users/UpdateUserIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/users/UpdateUserIntegrationTest.java
@@ -29,9 +29,9 @@ import io.restassured.http.Header;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.UserKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.UserKeycloakDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
import org.onap.portalng.bff.openapi.server.model.UpdateUserRequestApiDto;
import org.springframework.http.HttpStatus;
diff --git a/app/src/test/java/org/onap/portalng/bff/users/UpdateUserPasswordIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/UpdateUserPasswordIntegrationTest.java
index 0bdaaa9..cd38aeb 100644
--- a/app/src/test/java/org/onap/portalng/bff/users/UpdateUserPasswordIntegrationTest.java
+++ b/app/src/test/java/org/onap/portalng/bff/users/UpdateUserPasswordIntegrationTest.java
@@ -27,8 +27,8 @@ import com.github.tomakehurst.wiremock.client.WireMock;
import io.restassured.http.Header;
import org.junit.jupiter.api.Test;
import org.onap.portalng.bff.BaseIntegrationTest;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.CredentialKeycloakDto;
-import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.CredentialKeycloakDto;
+import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto;
import org.onap.portalng.bff.openapi.server.model.ProblemApiDto;
import org.onap.portalng.bff.openapi.server.model.UpdateUserPasswordRequestApiDto;
import org.springframework.http.HttpStatus;
diff --git a/app/src/test/resources/application-access-control.yml b/app/src/test/resources/application-access-control.yml
index 1eb37b8..0506066 100644
--- a/app/src/test/resources/application-access-control.yml
+++ b/app/src/test/resources/application-access-control.yml
@@ -9,8 +9,6 @@ bff.access-control:
PREFERENCES_GET: [onap_admin, onap_designer, onap_operator]
PREFERENCES_UPDATE: [onap_admin, onap_designer, onap_operator]
ROLE_LIST: ["*"]
- TILE_GET: [onap_admin, onap_designer, onap_operator]
- TILE_LIST: [onap_admin, onap_designer, onap_operator]
USER_CREATE: [onap_admin, onap_designer, onap_operator]
USER_DELETE: [onap_admin, onap_designer, onap_operator]
USER_GET: [onap_admin, onap_designer, onap_operator]
diff --git a/app/src/test/resources/application-development.yml b/app/src/test/resources/application-development.yml
index 2f408fe..2d53583 100644
--- a/app/src/test/resources/application-development.yml
+++ b/app/src/test/resources/application-development.yml
@@ -27,7 +27,6 @@ spring:
bff:
realm: ONAP
- portal-prefs-url: http://localhost:${wiremock.server.port}
- portal-history-url: http://localhost:${wiremock.server.port}
+ preferences-url: http://localhost:${wiremock.server.port}
+ history-url: http://localhost:${wiremock.server.port}
keycloak-url: http://localhost:${wiremock.server.port}
- instance-id: PORTAL
diff --git a/app/src/test/resources/application.yml b/app/src/test/resources/application.yml
index b26e5d4..789e870 100644
--- a/app/src/test/resources/application.yml
+++ b/app/src/test/resources/application.yml
@@ -28,7 +28,6 @@ spring:
bff:
realm: ONAP
- portal-prefs-url: http://localhost:${wiremock.server.port}
- portal-history-url: http://localhost:${wiremock.server.port}
+ preferences-url: http://localhost:${wiremock.server.port}
+ history-url: http://localhost:${wiremock.server.port}
keycloak-url: http://localhost:${wiremock.server.port}
- instance-id: PORTAL