Skip to content

Commit

Permalink
TSFF-1096: Gosys-mocken skal ikke telle med queryparametere som ikke …
Browse files Browse the repository at this point in the history
…regnes med når den sjekker om det er match på alle parametere
  • Loading branch information
inavga committed Feb 26, 2025
1 parent 91306ab commit aba7d6c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ public Response hentOppgaver(@Context HttpHeaders httpHeaders, @Context UriInfo

oppgaver.forEach((id, oppgave) -> {
AtomicInteger matches = new AtomicInteger();
AtomicInteger possibleMatches = new AtomicInteger();
queries.forEach((queryKey, queryValues) -> {
if (oppgave.hasNonNull(queryKey) && !queryValues.isEmpty()) {
possibleMatches.getAndIncrement();
JsonNode oppgaveValue = oppgave.get(queryKey);
String firstQueryValue = queryValues.get(0);
switch (oppgaveValue.getNodeType()) {
Expand All @@ -114,7 +116,7 @@ public Response hentOppgaver(@Context HttpHeaders httpHeaders, @Context UriInfo
}
}
});
if (matches.get() == queries.size()) matching.add(oppgave);
if (matches.get() == possibleMatches.get()) matching.add(oppgave);
});

return Response.ok()
Expand Down

0 comments on commit aba7d6c

Please sign in to comment.