Skip to content

Commit

Permalink
Merge pull request #401 from navikt/filter-hovedmal-gjeldende-vedtak
Browse files Browse the repository at this point in the history
Legg til hovedmål for gjeldande § 14 a-vedtak i filtermodell
  • Loading branch information
ingfo authored Nov 22, 2024
2 parents 7babe7c + bc5f4cc commit 4d46019
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 @@ -129,6 +129,9 @@ public class PortefoljeFilter {
@JsonSetter(nulls = Nulls.AS_EMPTY)
private List<String> innsatsgruppeGjeldendeVedtak14a = emptyList();

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

@JsonIgnore
public Boolean isNotEmpty() {
return (kjonn != null && !kjonn.isEmpty()) ||
Expand Down Expand Up @@ -167,6 +170,7 @@ public Boolean isNotEmpty() {
(barnUnder18AarAlder != null && !barnUnder18AarAlder.isEmpty()) ||
(fargekategorier != null && !fargekategorier.isEmpty()) ||
(gjeldendeVedtak14a != null && !gjeldendeVedtak14a.isEmpty()) ||
(innsatsgruppeGjeldendeVedtak14a != null && !innsatsgruppeGjeldendeVedtak14a.isEmpty());
(innsatsgruppeGjeldendeVedtak14a != null && !innsatsgruppeGjeldendeVedtak14a.isEmpty()) ||
(hovedmalGjeldendeVedtak14a != null && !hovedmalGjeldendeVedtak14a.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":[],"innsatsgruppeGjeldendeVedtak14a":[],"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":[],"hovedmal":[],"hovedmalGjeldendeVedtak14a":[],"innsatsgruppe":[],"innsatsgruppeGjeldendeVedtak14a":[],"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,"innsatsgruppeGjeldendeVedtak14a":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,"hovedmal":null,"hovedmalGjeldendeVedtak14a":null,"innsatsgruppe":null,"innsatsgruppeGjeldendeVedtak14a":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, 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(), 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(), emptyList(), emptyList());
}
}

0 comments on commit 4d46019

Please sign in to comment.