Skip to content

Commit

Permalink
Legg til filter for innsatsgruppe 14a
Browse files Browse the repository at this point in the history
Co-authored-by: Ingrid Fosså <[email protected]>
  • Loading branch information
sneha-d-desai committed Nov 19, 2024
1 parent dc035c1 commit 0acb3e4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ public class PortefoljeFilter {
@JsonSetter(nulls = Nulls.AS_EMPTY)
private List<String> gjeldendeVedtak14a = emptyList();

@JsonSetter(nulls = Nulls.AS_EMPTY)
private List<String> innsatsgruppeGjeldendeVedtak14a = emptyList();

@JsonIgnore
public Boolean isNotEmpty() {
return (kjonn != null && !kjonn.isEmpty()) ||
Expand Down Expand Up @@ -163,6 +166,7 @@ public Boolean isNotEmpty() {
(barnUnder18Aar != null && !barnUnder18Aar.isEmpty()) ||
(barnUnder18AarAlder != null && !barnUnder18AarAlder.isEmpty()) ||
(fargekategorier != null && !fargekategorier.isEmpty()) ||
(gjeldendeVedtak14a != null && !gjeldendeVedtak14a.isEmpty());
(gjeldendeVedtak14a != null && !gjeldendeVedtak14a.isEmpty()) ||
(innsatsgruppeGjeldendeVedtak14a != null && !innsatsgruppeGjeldendeVedtak14a.isEmpty());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void testDeserializationAndSettingDefaultValue() throws JsonProcessingExc
@Test
public void testSerializationOfEmptyFilter() throws JsonProcessingException {
String correctOutput = """
{"aktiviteter":null,"aktiviteterForenklet":[],"alder":[],"arbeidslisteKategori":[],"avvik14aVedtak":[],"barnUnder18Aar":[],"barnUnder18AarAlder":[],"cvJobbprofil":"","ensligeForsorgere":[],"fargekategorier":[],"ferdigfilterListe":[],"fodselsdagIMnd":[],"foedeland":[],"formidlingsgruppe":[],"geografiskBosted":[],"gjeldendeVedtak14a":[],"hovedmal":[],"innsatsgruppe":[],"kjonn":"","landgruppe":[],"manuellBrukerStatus":[],"navnEllerFnrQuery":"","registreringstype":[],"rettighetsgruppe":[],"servicegruppe":[],"sisteEndringKategori":[],"stillingFraNavFilter":[],"tiltakstyper":[],"tolkBehovSpraak":[],"tolkebehov":[],"ulesteEndringer":"","utdanning":[],"utdanningBestatt":[],"utdanningGodkjent":[],"veilederNavnQuery":"","veiledere":[],"visGeografiskBosted":[],"ytelse":""}""";
{"aktiviteter":null,"aktiviteterForenklet":[],"alder":[],"arbeidslisteKategori":[],"avvik14aVedtak":[],"barnUnder18Aar":[],"barnUnder18AarAlder":[],"cvJobbprofil":"","ensligeForsorgere":[],"fargekategorier":[],"ferdigfilterListe":[],"fodselsdagIMnd":[],"foedeland":[],"formidlingsgruppe":[],"geografiskBosted":[],"gjeldendeVedtak14a":[],"innsatsgruppeGjeldendeVedtak14a":null,"hovedmal":[],"innsatsgruppe":[],"kjonn":"","landgruppe":[],"manuellBrukerStatus":[],"navnEllerFnrQuery":"","registreringstype":[],"rettighetsgruppe":[],"servicegruppe":[],"sisteEndringKategori":[],"stillingFraNavFilter":[],"tiltakstyper":[],"tolkBehovSpraak":[],"tolkebehov":[],"ulesteEndringer":"","utdanning":[],"utdanningBestatt":[],"utdanningGodkjent":[],"veilederNavnQuery":"","veiledere":[],"visGeografiskBosted":[],"ytelse":""}""";
PortefoljeFilter portefoljeFilter = new PortefoljeFilter();
String jsonString = objectMapper.writeValueAsString(portefoljeFilter);
Assertions.assertEquals(jsonString, correctOutput);
Expand All @@ -107,10 +107,10 @@ public void testSerializationOfEmptyFilter() throws JsonProcessingException {
@Test
public void testSerializationOfVeiledere() throws JsonProcessingException {
String correctOutput = """
{"aktiviteter":null,"aktiviteterForenklet":null,"alder":null,"arbeidslisteKategori":null,"avvik14aVedtak":null,"barnUnder18Aar":null,"barnUnder18AarAlder":null,"cvJobbprofil":null,"ensligeForsorgere":null,"fargekategorier":null,"ferdigfilterListe":null,"fodselsdagIMnd":null,"foedeland":null,"formidlingsgruppe":null,"geografiskBosted":null,"gjeldendeVedtak14a":null,"hovedmal":null,"innsatsgruppe":null,"kjonn":null,"landgruppe":null,"manuellBrukerStatus":null,"navnEllerFnrQuery":null,"registreringstype":null,"rettighetsgruppe":null,"servicegruppe":null,"sisteEndringKategori":null,"stillingFraNavFilter":null,"tiltakstyper":null,"tolkBehovSpraak":null,"tolkebehov":null,"ulesteEndringer":null,"utdanning":null,"utdanningBestatt":null,"utdanningGodkjent":null,"veilederNavnQuery":null,"veiledere":["A123","B123"],"visGeografiskBosted":null,"ytelse":null}""";
{"aktiviteter":null,"aktiviteterForenklet":null,"alder":null,"arbeidslisteKategori":null,"avvik14aVedtak":null,"barnUnder18Aar":null,"barnUnder18AarAlder":null,"cvJobbprofil":null,"ensligeForsorgere":null,"fargekategorier":null,"ferdigfilterListe":null,"fodselsdagIMnd":null,"foedeland":null,"formidlingsgruppe":null,"geografiskBosted":null,"gjeldendeVedtak14a":null,"innsatsgruppeGjeldendeVedtak14a":null,"hovedmal":null,"innsatsgruppe":null,"kjonn":null,"landgruppe":null,"manuellBrukerStatus":null,"navnEllerFnrQuery":null,"registreringstype":null,"rettighetsgruppe":null,"servicegruppe":null,"sisteEndringKategori":null,"stillingFraNavFilter":null,"tiltakstyper":null,"tolkBehovSpraak":null,"tolkebehov":null,"ulesteEndringer":null,"utdanning":null,"utdanningBestatt":null,"utdanningGodkjent":null,"veilederNavnQuery":null,"veiledere":["A123","B123"],"visGeografiskBosted":null,"ytelse":null}""";
PortefoljeFilter portefoljeFilter = new PortefoljeFilter(null, null, null, null, null, null, null, null, null, null,
null, null, null, null, List.of("A123", "B123"), null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null,null, null, null, null, null, null, null, null);
null, null, null, null, null,null, null, null, null, null, null, null, null, null);
String jsonString = objectMapper.writeValueAsString(portefoljeFilter);
Assertions.assertEquals(jsonString, correctOutput);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public PortefoljeFilter getRandomPortefoljeFilter() {
emptyList(), emptyList(), emptyList(), emptyList(), kjonnVelg.get(random.nextInt(1)), emptyList(),
String.valueOf(rndChar()), emptyList(), emptyList(), emptyList(), "", emptyList(), "", emptyList(), "",
emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), "", emptyList(), emptyList(), emptyList(),
emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList());
emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList());
}

private static char rndChar() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,6 @@ private NyttFilterModel getRandomNyttFilter(List<String> veiledersList) {
public PortefoljeFilter getRandomPortefoljeFilter(List<String> veiledersList) {
return new PortefoljeFilter(null, emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), "",
emptyList(), "", emptyList(), emptyList(), emptyList(), "", veiledersList, "", emptyList(), "", emptyList(),
emptyList(), emptyList(), emptyList(), emptyList(), "", emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList());
emptyList(), emptyList(), emptyList(), emptyList(), "", emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList(), emptyList());
}
}

0 comments on commit 0acb3e4

Please sign in to comment.