From 83b6b32c089233860eaaf27046fdb9b91f1dc0e8 Mon Sep 17 00:00:00 2001 From: JordenReuter <149687553+JordenReuter@users.noreply.github.com> Date: Mon, 4 Mar 2024 10:47:43 +0100 Subject: [PATCH] feat: adjusted permission search criteria to align to svc (#11) --- src/main/openapi/openapi-bff.yaml | 6 ++++-- .../onecx/permission/rs/PermissionRestControllerTest.java | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/openapi/openapi-bff.yaml b/src/main/openapi/openapi-bff.yaml index 5279b20..b732a2c 100644 --- a/src/main/openapi/openapi-bff.yaml +++ b/src/main/openapi/openapi-bff.yaml @@ -510,8 +510,10 @@ components: properties: appId: type: string - productName: - type: string + productNames: + type: array + items: + type: string pageNumber: format: int32 description: The number of page. diff --git a/src/test/java/org/tkit/onecx/permission/rs/PermissionRestControllerTest.java b/src/test/java/org/tkit/onecx/permission/rs/PermissionRestControllerTest.java index 911f173..e5343c3 100644 --- a/src/test/java/org/tkit/onecx/permission/rs/PermissionRestControllerTest.java +++ b/src/test/java/org/tkit/onecx/permission/rs/PermissionRestControllerTest.java @@ -38,10 +38,12 @@ void searchPermissionsByCriteriaTest() { PermissionSearchCriteria criteria = new PermissionSearchCriteria(); criteria.pageNumber(1).appId("app1").pageSize(1); + criteria.setProductNames(List.of("product1")); PermissionPageResult pageResult = new PermissionPageResult(); Permission permission = new Permission(); permission.appId("app1").action("delete").id("id1"); + permission.setProductName("product1"); pageResult.stream(List.of(permission)).size(1).number(1).totalElements(1L).totalPages(1L); // create mock rest endpoint @@ -53,7 +55,7 @@ void searchPermissionsByCriteriaTest() { .withBody(JsonBody.json(pageResult))); PermissionSearchCriteriaDTO criteriaDTO = new PermissionSearchCriteriaDTO(); - criteriaDTO.pageNumber(1).appId("app1").pageSize(1); + criteriaDTO.pageNumber(1).appId("app1").pageSize(1).productNames(List.of("product1")); var output = given() .when()