Skip to content

Commit

Permalink
Gå direkte mot SAF istedet via dp-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
geiralund committed May 7, 2024
1 parent c4f4d31 commit c03858c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import no.nav.dagpenger.mottak.behov.journalpost.FerdigstillJournalpostBehovLøs
import no.nav.dagpenger.mottak.behov.journalpost.JournalpostApiClient
import no.nav.dagpenger.mottak.behov.journalpost.JournalpostBehovLøser
import no.nav.dagpenger.mottak.behov.journalpost.OppdaterJournalpostBehovLøser
import no.nav.dagpenger.mottak.behov.journalpost.SafClient
import no.nav.dagpenger.mottak.behov.journalpost.SøknadsdataBehovLøser
import no.nav.dagpenger.mottak.behov.journalpost.UnleashSafClient
import no.nav.dagpenger.mottak.behov.person.PdlPersondataOppslag
import no.nav.dagpenger.mottak.behov.person.PersondataBehovLøser
import no.nav.dagpenger.mottak.behov.person.SkjermingOppslag
Expand All @@ -32,7 +32,7 @@ private val logg = KotlinLogging.logger {}

internal class ApplicationBuilder(env: Map<String, String>) : RapidsConnection.StatusListener {
private val innsendingRepository = InnsendingPostgresRepository(PostgresDataSourceBuilder.dataSource)
private val safClient = UnleashSafClient(Config.properties, unleash)
private val safClient = SafClient(Config.properties)
private val arenaApiClient = ArenaApiClient(Config.properties)
private val journalpostApiClient = JournalpostApiClient(tokenProvider = Config.properties.dokarkivTokenProvider)
private val gosysOppslag = GosysClient(Config.properties)
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotliquery.queryOf
import kotliquery.sessionOf
import kotliquery.using
import mu.KotlinLogging
import no.nav.dagpenger.mottak.behov.journalpost.SafProxyClient
import no.nav.dagpenger.mottak.behov.journalpost.SafClient
import no.nav.dagpenger.mottak.db.PostgresDataSourceBuilder
import org.postgresql.util.PGobject
import javax.sql.DataSource
Expand All @@ -15,7 +15,7 @@ private val logger = KotlinLogging.logger {}
private val sikkerlogg = KotlinLogging.logger("tjenestekall.SøknadsDataVaktmester")

internal class SøknadsDataVaktmester(
private val safProxyClient: SafProxyClient,
private val safClient: SafClient,
private val ds: DataSource = PostgresDataSourceBuilder.dataSource,
) {
fun fixSoknadsData(jp: Int) {
Expand All @@ -24,7 +24,7 @@ internal class SøknadsDataVaktmester(
if (session.lås(jp)) {
val (innsendingId, dokumentinfoId) = session.innsendingIdOgDokumentinfoId(jp)
runBlocking {
val data = safProxyClient.hentSøknadsData(jp.toString(), dokumentinfoId.toString()).data.toString()
val data = safClient.hentSøknadsData(jp.toString(), dokumentinfoId.toString()).data.toString()
session.insertSøknadsData(innsendingId, data)
logger.info { "Oppdatert søknads data for journalpost id $jp" }
sikkerlogg.info { "Oppdatert søknads data for journalpost id $jp. Søknadsdata: $data" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import kotliquery.sessionOf
import kotliquery.using
import no.nav.dagpenger.innsendingData
import no.nav.dagpenger.mottak.behov.JsonMapper
import no.nav.dagpenger.mottak.behov.journalpost.SafClient
import no.nav.dagpenger.mottak.behov.journalpost.SafGraphQL
import no.nav.dagpenger.mottak.behov.journalpost.SafProxyClient
import no.nav.dagpenger.mottak.db.InnsendingPostgresRepository
import no.nav.dagpenger.mottak.db.PostgresDataSourceBuilder
import no.nav.dagpenger.mottak.db.PostgresTestHelper
Expand All @@ -24,8 +24,8 @@ class SøknadsDataVaktmesterTest {
InnsendingPostgresRepository().lagre(innsending)

SøknadsDataVaktmester(
safProxyClient =
mockk<SafProxyClient>().also {
safClient =
mockk<SafClient>().also {
coEvery {
it.hentSøknadsData(innsending.journalpostId(), "12345678")
} returns SafGraphQL.SøknadsData.fromJson("""{"hubba": "bubba"}""")
Expand Down

0 comments on commit c03858c

Please sign in to comment.