diff --git a/src/main/java/org/tkit/onecx/workspace/rs/internal/mappers/MenuItemMapper.java b/src/main/java/org/tkit/onecx/workspace/rs/internal/mappers/MenuItemMapper.java index 0d0bedb..cf34bf4 100644 --- a/src/main/java/org/tkit/onecx/workspace/rs/internal/mappers/MenuItemMapper.java +++ b/src/main/java/org/tkit/onecx/workspace/rs/internal/mappers/MenuItemMapper.java @@ -164,7 +164,7 @@ default MenuItemStructureDTO mapTreeByRoles(List entities, Map topMenuItems = parentChildrenMap.getOrDefault("TOP", new ArrayList<>()).stream() .map(menuItem -> mapTreeItemWithChildren(menuItem, parentChildrenMap)) - .collect(Collectors.toList()); + .toList(); dto.setMenuItems(topMenuItems); return dto; @@ -177,7 +177,7 @@ private WorkspaceMenuItemDTO mapTreeItemWithChildren(MenuItem menuItem, Map childDTOs = children.stream() .map(child -> mapTreeItemWithChildren(child, parentChildrenMap)) - .collect(Collectors.toList()); + .toList(); dto.setChildren(childDTOs); } else { dto.setChildren(new ArrayList<>()); diff --git a/src/test/java/org/tkit/onecx/workspace/rs/internal/controllers/MenuInternalRestControllerTest.java b/src/test/java/org/tkit/onecx/workspace/rs/internal/controllers/MenuInternalRestControllerTest.java index 2a2bca7..5629650 100644 --- a/src/test/java/org/tkit/onecx/workspace/rs/internal/controllers/MenuInternalRestControllerTest.java +++ b/src/test/java/org/tkit/onecx/workspace/rs/internal/controllers/MenuInternalRestControllerTest.java @@ -323,8 +323,8 @@ void getMenuStructureForWorkspaceIdAndRolesTest() { .extract().body().as(MenuItemStructureDTO.class); assertThat(data).isNotNull(); - assertThat(data.getMenuItems()).hasSize(0); - assertThat(countMenuItems(data.getMenuItems())).isEqualTo(0); + assertThat(data.getMenuItems()).isEmpty(); + assertThat(countMenuItems(data.getMenuItems())).isZero(); criteria = new MenuStructureSearchCriteriaDTO().workspaceId("11-111").roles(List.of("role3"));