From 10d94d08a4f4f798cec0af137651da413179220e Mon Sep 17 00:00:00 2001 From: zia alborzi Date: Fri, 26 Jul 2024 15:10:05 +0200 Subject: [PATCH] fix test --- .../discovery/utils/PackageShowMapper.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/github/genomicdatainfrastructure/discovery/utils/PackageShowMapper.java b/src/main/java/io/github/genomicdatainfrastructure/discovery/utils/PackageShowMapper.java index 40fe93f..37ad586 100644 --- a/src/main/java/io/github/genomicdatainfrastructure/discovery/utils/PackageShowMapper.java +++ b/src/main/java/io/github/genomicdatainfrastructure/discovery/utils/PackageShowMapper.java @@ -106,14 +106,13 @@ private List values(List values) { return ofNullable(values) .orElseGet(List::of) .stream() - .filter(Objects::nonNull) .map(PackageShowMapper::value) + .filter(Objects::nonNull) .toList(); } private ValueLabel value(String value) { return ofNullable(value) - .filter(Objects::nonNull) .filter(not(String::isBlank)) .map(it -> ValueLabel.builder() .value(it) @@ -123,10 +122,13 @@ private ValueLabel value(String value) { } private ValueLabel value(CkanValueLabel value) { - return ValueLabel.builder() - .value(value.getName()) - .label(value.getDisplayName()) - .build(); + return ofNullable(value) + .map(it -> ValueLabel.builder() + .value(value.getName()) + .label(value.getDisplayName()) + .build()) + .orElse(null); + } private LocalDateTime parse(String date) {