diff --git a/mocks/oppgave-mock/src/main/java/no/nav/oppgave/OppgaveMockImpl.java b/mocks/oppgave-mock/src/main/java/no/nav/oppgave/OppgaveMockImpl.java index 94b0d5a97..47aa993e4 100644 --- a/mocks/oppgave-mock/src/main/java/no/nav/oppgave/OppgaveMockImpl.java +++ b/mocks/oppgave-mock/src/main/java/no/nav/oppgave/OppgaveMockImpl.java @@ -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()) { @@ -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()