Skip to content

Commit ed36e98

Browse files
committed
Fix error message formatting in AaregClient and update condition in isNyttArbeidsforhold method
1 parent b0ca2ca commit ed36e98

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/AaregClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ private Mono<String> getErrors(Throwable error, Set<String> miljoer) {
8585

8686
var decoded = WebClientError.describe(error);
8787
return Mono.just(miljoer.stream()
88-
.map(miljoe -> "%s:Feil= %s".formatted(miljoe, ErrorStatusDecoder.encodeStatus(decoded.getStatus() +
89-
(isBlank(decoded.getMessage()) ? "" : "= %s".formatted(decoded.getMessage())))))
88+
.map(miljoe -> "%s:Feil= %s".formatted(miljoe, ErrorStatusDecoder.encodeStatus(
89+
(isBlank(decoded.getMessage()) ? decoded.getStatus().toString() : decoded.getMessage()))))
9090
.collect(Collectors.joining(",")));
9191
}
9292

apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/util/AaregUtility.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import java.util.Map;
1616
import java.util.concurrent.atomic.AtomicInteger;
1717

18-
import static java.util.Objects.isNull;
1918
import static java.util.Objects.nonNull;
2019
import static org.apache.commons.lang3.StringUtils.isBlank;
2120

@@ -82,7 +81,7 @@ public static Arbeidsforhold appendArbeidsforholdId(Arbeidsforhold arbeidsforhol
8281

8382
public static boolean isNyttArbeidsforhold(List<Arbeidsforhold> response, Arbeidsforhold request) {
8483

85-
return isNull(request.getArbeidsforholdId()) &&
84+
return isBlank(request.getArbeidsforholdId()) &&
8685
response.stream().noneMatch(eksisterende ->
8786
(isArbeidsgiverOrganisasjonAlike(eksisterende, request) ||
8887
isArbeidsgiverPersonAlike(eksisterende, request)) &&

0 commit comments

Comments
 (0)