Skip to content

Commit

Permalink
fix: sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
JordenReuter committed Dec 9, 2024
1 parent 814d24c commit 9027827
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ default MenuItemStructureDTO mapTreeByRoles(List<MenuItem> entities, Map<String,

List<WorkspaceMenuItemDTO> topMenuItems = parentChildrenMap.getOrDefault("TOP", new ArrayList<>()).stream()
.map(menuItem -> mapTreeItemWithChildren(menuItem, parentChildrenMap))
.collect(Collectors.toList());
.toList();

dto.setMenuItems(topMenuItems);
return dto;
Expand All @@ -177,7 +177,7 @@ private WorkspaceMenuItemDTO mapTreeItemWithChildren(MenuItem menuItem, Map<Stri
if (children != null) {
List<WorkspaceMenuItemDTO> childDTOs = children.stream()
.map(child -> mapTreeItemWithChildren(child, parentChildrenMap))
.collect(Collectors.toList());
.toList();
dto.setChildren(childDTOs);
} else {
dto.setChildren(new ArrayList<>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down

0 comments on commit 9027827

Please sign in to comment.