Skip to content

Commit

Permalink
feat: handle null value and adjusted test (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordenReuter authored May 17, 2024
1 parent 5f88b67 commit 99cdb70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

import org.mapstruct.AfterMapping;
Expand Down Expand Up @@ -110,6 +111,7 @@ default SlotDTO createSlot(WorkspaceWrapperSlot slot) {

SlotDTO result = new SlotDTO().name(slot.getName());
if (slot.getComponents() != null) {
slot.getComponents().removeIf(Objects::isNull);
slot.getComponents()
.forEach(c -> result.addComponentsItem(componentName(c.getProductName(), c.getAppId(), c.getName())));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ void loadWorkspaceConfigByBaseUrlTest() {
.addMicrofrontendsItem(new Microfrontend().basePath("/app1").mfeId("app1")))
.addSlotsItem(
new WorkspaceWrapperSlot().name("slot1")
.addComponentsItem(null)
.addComponentsItem(
new WorkspaceWrapperComponent().productName("product1").appId("app1")
.name("App1Component"))
Expand Down

0 comments on commit 99cdb70

Please sign in to comment.