diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-05-07 14:20:16 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-05-07 14:20:16 +0200 |
commit | 25bd84ec32115b346cab66eeed9dc47cd574d12b (patch) | |
tree | 7c8cff4489fe48b54a1a40f152b0d86a56efd0ed /app | |
parent | be08f91dac2b018fb9a08c89e3961ebc0263a1a4 (diff) |
Read app version from version.properties
- read app version from version.properties
- make openapi dependencies compileOnly
- run spotless formatter
Issue-ID: PORTALNG-94
Change-Id: I3d3b9f057bc998d90763101ac8f3b32a0df280c1
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'app')
7 files changed, 39 insertions, 56 deletions
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 bfc868d..7928c3b 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 @@ -226,15 +226,13 @@ class CreateUserIntegrationTest extends BaseIntegrationTest { WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) .withHeader( - "location", - String.format("/admin/realms/%s/users/%s", realm, userId)))); + "location", String.format("/admin/realms/%s/users/%s", realm, userId)))); } protected void mockGetUser(String userId, UserKeycloakDto response) throws Exception { WireMock.stubFor( WireMock.get( - WireMock.urlMatching( - String.format("/admin/realms/%s/users/%s", realm, userId))) + WireMock.urlMatching(String.format("/admin/realms/%s/users/%s", realm, userId))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) @@ -245,8 +243,7 @@ class CreateUserIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.post( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users/%s/role-mappings/realm", realm, userId))) + String.format("/admin/realms/%s/users/%s/role-mappings/realm", realm, userId))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) @@ -276,8 +273,7 @@ class CreateUserIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users/%s/role-mappings/realm", realm, userID))) + String.format("/admin/realms/%s/users/%s/role-mappings/realm", realm, userID))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) 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 6766af8..337d3e3 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 @@ -117,8 +117,7 @@ class GetUserDetailIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users/%s/role-mappings/realm", realm, userID))) + String.format("/admin/realms/%s/users/%s/role-mappings/realm", realm, userID))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) 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 d8fb3c7..06d9b89 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 @@ -47,8 +47,7 @@ class ListAvailableRolesIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users/1/role-mappings/realm/available", realm))) + String.format("/admin/realms/%s/users/1/role-mappings/realm/available", realm))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) @@ -83,8 +82,7 @@ class ListAvailableRolesIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users/1/role-mappings/realm/available", realm))) + String.format("/admin/realms/%s/users/1/role-mappings/realm/available", realm))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) 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 d4d74da..2b5fdb4 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 @@ -162,8 +162,7 @@ class ListUsersIntegrationTest extends BaseIntegrationTest { protected void mockGetUserCount(Integer userCount) { WireMock.stubFor( - WireMock.get( - WireMock.urlMatching(String.format("/admin/realms/%s/users/count", realm))) + WireMock.get(WireMock.urlMatching(String.format("/admin/realms/%s/users/count", realm))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) @@ -175,8 +174,7 @@ class ListUsersIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users\\?first=%s&max=%s", realm, first, max))) + String.format("/admin/realms/%s/users\\?first=%s&max=%s", realm, first, max))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) @@ -227,8 +225,7 @@ class ListUsersIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users\\?first=%s&max=%s", realm, first, max))) + String.format("/admin/realms/%s/users\\?first=%s&max=%s", realm, first, max))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) 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 a69e969..9fcff3b 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 @@ -54,8 +54,7 @@ class UpdateAssignedRolesIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users/1/role-mappings/realm/available", realm))) + String.format("/admin/realms/%s/users/1/role-mappings/realm/available", realm))) .inScenario("test") .whenScenarioStateIs(Scenario.STARTED) .willReturn( @@ -138,8 +137,7 @@ class UpdateAssignedRolesIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users/1/role-mappings/realm/available", realm))) + String.format("/admin/realms/%s/users/1/role-mappings/realm/available", realm))) .inScenario("test") .whenScenarioStateIs(Scenario.STARTED) .willReturn( @@ -226,8 +224,7 @@ class UpdateAssignedRolesIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users/1/role-mappings/realm/available", realm))) + String.format("/admin/realms/%s/users/1/role-mappings/realm/available", realm))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) @@ -288,8 +285,7 @@ class UpdateAssignedRolesIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users/1/role-mappings/realm/available", realm))) + String.format("/admin/realms/%s/users/1/role-mappings/realm/available", realm))) .inScenario("test") .whenScenarioStateIs(Scenario.STARTED) .willReturn( @@ -374,8 +370,7 @@ class UpdateAssignedRolesIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users/1/role-mappings/realm/available", realm))) + String.format("/admin/realms/%s/users/1/role-mappings/realm/available", realm))) .inScenario("test") .whenScenarioStateIs(Scenario.STARTED) .willReturn( 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 3ce7d8b..349909f 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 @@ -101,8 +101,7 @@ class UpdateUserIntegrationTest extends BaseIntegrationTest { protected void mockUpdateUser(UserKeycloakDto request, String userId) throws Exception { WireMock.stubFor( WireMock.put( - WireMock.urlMatching( - String.format("/admin/realms/%s/users/%s", realm, userId))) + WireMock.urlMatching(String.format("/admin/realms/%s/users/%s", realm, userId))) .withRequestBody(WireMock.equalTo(objectMapper.writeValueAsString(request))) .willReturn( WireMock.aResponse().withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE))); @@ -111,8 +110,7 @@ class UpdateUserIntegrationTest extends BaseIntegrationTest { protected void mockGetUser(String userId, UserKeycloakDto response) throws Exception { WireMock.stubFor( WireMock.get( - WireMock.urlMatching( - String.format("/admin/realms/%s/users/%s", realm, userId))) + WireMock.urlMatching(String.format("/admin/realms/%s/users/%s", realm, userId))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) @@ -124,8 +122,7 @@ class UpdateUserIntegrationTest extends BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format( - "/admin/realms/%s/users/%s/role-mappings/realm", realm, userID))) + String.format("/admin/realms/%s/users/%s/role-mappings/realm", realm, userID))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE) diff --git a/app/src/test/resources/application-access-control.yml b/app/src/test/resources/application-access-control.yml index ad470ce..6fda781 100644 --- a/app/src/test/resources/application-access-control.yml +++ b/app/src/test/resources/application-access-control.yml @@ -1,20 +1,21 @@ -bff.access-control: - ACTIONS_CREATE: [ portal_admin, portal_designer, portal_operator ] - ACTIONS_GET: [ portal_admin, portal_designer, portal_operator ] - ACTIONS_LIST: [ portal_admin, portal_designer, portal_operator ] - ACTIVE_ALARM_LIST: [portal_admin, portal_designer, portal_operator] - KEY_ENCRYPT_BY_USER: [portal_admin, portal_designer, portal_operator] - KEY_ENCRYPT_BY_VALUE: [portal_admin, portal_designer, portal_operator] - PREFERENCES_CREATE: [portal_admin, portal_designer, portal_operator] - PREFERENCES_GET: [portal_admin, portal_designer, portal_operator] - PREFERENCES_UPDATE: [portal_admin, portal_designer, portal_operator] - ROLE_LIST: ["*"] - USER_CREATE: [portal_admin, portal_designer, portal_operator] - USER_DELETE: [portal_admin, portal_designer, portal_operator] - USER_GET: [portal_admin, portal_designer, portal_operator] - USER_LIST_AVAILABLE_ROLES: [portal_admin, portal_designer, portal_operator] - USER_LIST_ROLES: [portal_admin, portal_designer, portal_operator] - USER_LIST: [portal_admin, portal_designer, portal_operator] - USER_UPDATE_PASSWORD: [portal_admin, portal_designer, portal_operator] - USER_UPDATE_ROLES: [portal_admin, portal_designer, portal_operator] - USER_UPDATE: [portal_admin, portal_designer, portal_operator] +bff: + access-control: + ACTIONS_CREATE: [ portal_admin, portal_designer, portal_operator ] + ACTIONS_GET: [ portal_admin, portal_designer, portal_operator ] + ACTIONS_LIST: [ portal_admin, portal_designer, portal_operator ] + ACTIVE_ALARM_LIST: [portal_admin, portal_designer, portal_operator] + KEY_ENCRYPT_BY_USER: [portal_admin, portal_designer, portal_operator] + KEY_ENCRYPT_BY_VALUE: [portal_admin, portal_designer, portal_operator] + PREFERENCES_CREATE: [portal_admin, portal_designer, portal_operator] + PREFERENCES_GET: [portal_admin, portal_designer, portal_operator] + PREFERENCES_UPDATE: [portal_admin, portal_designer, portal_operator] + ROLE_LIST: ["*"] + USER_CREATE: [portal_admin, portal_designer, portal_operator] + USER_DELETE: [portal_admin, portal_designer, portal_operator] + USER_GET: [portal_admin, portal_designer, portal_operator] + USER_LIST_AVAILABLE_ROLES: [portal_admin, portal_designer, portal_operator] + USER_LIST_ROLES: [portal_admin, portal_designer, portal_operator] + USER_LIST: [portal_admin, portal_designer, portal_operator] + USER_UPDATE_PASSWORD: [portal_admin, portal_designer, portal_operator] + USER_UPDATE_ROLES: [portal_admin, portal_designer, portal_operator] + USER_UPDATE: [portal_admin, portal_designer, portal_operator] |