Skip to content

Commit

Permalink
Flytte litt til konfig
Browse files Browse the repository at this point in the history
  • Loading branch information
dijjal committed Dec 13, 2023
1 parent ab3a720 commit c5fa638
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package no.nav.foreldrepenger.los.web.app.konfig;
package no.nav.foreldrepenger.los.konfig;

import io.swagger.v3.jaxrs2.integration.resources.OpenApiResource;
import io.swagger.v3.oas.integration.GenericOpenApiContextBuilder;
Expand All @@ -12,7 +12,6 @@
import no.nav.foreldrepenger.los.web.app.exceptions.GeneralRestExceptionMapper;
import no.nav.foreldrepenger.los.web.app.exceptions.JsonMappingExceptionMapper;
import no.nav.foreldrepenger.los.web.app.exceptions.JsonParseExceptionMapper;
import no.nav.foreldrepenger.los.web.app.jackson.JacksonJsonConfig;
import no.nav.foreldrepenger.los.web.app.tjenester.admin.AdminRestTjeneste;
import no.nav.foreldrepenger.los.web.app.tjenester.admin.DriftsmeldingerRestTjeneste;
import no.nav.foreldrepenger.los.web.app.tjenester.avdelingsleder.AvdelingslederRestTjeneste;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package no.nav.foreldrepenger.los.web.app.konfig;
package no.nav.foreldrepenger.los.konfig;

import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package no.nav.foreldrepenger.los.web.app.jackson;
package no.nav.foreldrepenger.los.konfig;

import java.net.URISyntaxException;
import java.util.List;
Expand Down Expand Up @@ -50,7 +50,7 @@ public ObjectMapper getContext(Class<?> type) {
private static SimpleModule createModule(boolean serialiserKodeverdiSomObjekt) {
var module = new SimpleModule("VL-REST", new Version(1, 0, 0, null, null, null));

module.addSerializer(new KodeverdiSerializer(serialiserKodeverdiSomObjekt));
module.addSerializer(new JacksonKodeverdiSerializer(serialiserKodeverdiSomObjekt));

return module;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package no.nav.foreldrepenger.los.web.app.jackson;
package no.nav.foreldrepenger.los.konfig;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
Expand All @@ -16,11 +16,11 @@
* <p>
* TODO: Flytt til web kodeverk KodeverRestTjeneste når all normal (De)Ser av Kodeverdi skjer med JsonValue
*/
public class KodeverdiSerializer extends StdSerializer<Kodeverdi> {
public class JacksonKodeverdiSerializer extends StdSerializer<Kodeverdi> {

private boolean serialiserKodelisteNavn;

public KodeverdiSerializer(boolean serialiserKodelisteNavn) {
public JacksonKodeverdiSerializer(boolean serialiserKodelisteNavn) {
super(Kodeverdi.class);
this.serialiserKodelisteNavn = serialiserKodelisteNavn;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import no.nav.foreldrepenger.los.oppgave.FagsakStatus;
import no.nav.foreldrepenger.los.oppgave.FagsakYtelseType;
import no.nav.foreldrepenger.los.oppgavekø.KøSortering;
import no.nav.foreldrepenger.los.web.app.jackson.JacksonJsonConfig;
import no.nav.foreldrepenger.los.konfig.JacksonJsonConfig;
import no.nav.foreldrepenger.los.web.app.tjenester.avdelingsleder.nøkkeltall.åpnebehandlinger.dto.BehandlingVenteStatus;
import no.nav.vedtak.sikkerhet.abac.BeskyttetRessurs;
import no.nav.vedtak.sikkerhet.abac.beskyttet.ActionType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import jakarta.ws.rs.Path;
import jakarta.ws.rs.core.Application;
import no.nav.foreldrepenger.los.konfig.ApiConfig;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
Expand All @@ -16,10 +17,10 @@ public class RestApiTester {

static Collection<Method> finnAlleRestMetoder() {
return finnAktuelleRestTjenester(new ApiConfig()).stream()
.map(Class::getDeclaredMethods)
.flatMap(Arrays::stream)
.filter(m -> Modifier.isPublic(m.getModifiers()))
.collect(Collectors.toList());
.map(Class::getDeclaredMethods)
.flatMap(Arrays::stream)
.filter(m -> Modifier.isPublic(m.getModifiers()))
.collect(Collectors.toList());
}

private static Collection<Class<?>> finnAktuelleRestTjenester(Application config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import no.nav.foreldrepenger.los.oppgave.FagsakStatus;
import no.nav.foreldrepenger.los.oppgavekø.KøSortering;
import no.nav.foreldrepenger.los.web.app.jackson.JacksonJsonConfig;
import no.nav.foreldrepenger.los.konfig.JacksonJsonConfig;

import org.junit.jupiter.api.Test;

Expand Down

0 comments on commit c5fa638

Please sign in to comment.