Skip to content

Commit

Permalink
F - Slipper gjennom alle uten bruker i test
Browse files Browse the repository at this point in the history
  • Loading branch information
dskarpas committed Sep 5, 2024
1 parent 6c63ff5 commit 17f3dd1
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class JournalforingService(
private val statistikkPublisher: StatistikkPublisher,
private val vurderBrukerInfo: VurderBrukerInfo,
@Autowired(required = false) private val metricsHelper: MetricsHelper = MetricsHelper.ForTest(),
@Value("\${ENV}") private val env : String?,
) {

private val logger = LoggerFactory.getLogger(JournalforingService::class.java)
Expand Down Expand Up @@ -180,10 +181,14 @@ class JournalforingService(
)

if (journalpostRequest.bruker == null) {
val logMelding = if (sedHendelse.bucType in listOf(R_BUC_02, P_BUC_06, P_BUC_09)) {
val logMelding = if (sedHendelse.bucType in listOf(R_BUC_02, P_BUC_06, P_BUC_09) ) {
journalpostService.sendJournalPost(JournalpostMedSedInfo(journalpostRequest, sedHendelse, hendelseType), "eessipensjon")
"Journalpost for rinanr: ${sedHendelse.rinaSakId} mangler bruker, men sendes direkte"
} else {
} else if(env != null && env in listOf("test")){
journalpostService.sendJournalPost(JournalpostMedSedInfo(journalpostRequest, sedHendelse, hendelseType), "eessipensjon")
"Journalpost for rinanr: ${sedHendelse.rinaSakId} mangler bruker, men miljøet er ${env} og sendes direkte"
}
else {
vurderBrukerInfo.journalPostUtenBruker(journalpostRequest, sedHendelse, hendelseType)
"Journalpost for rinanr: ${sedHendelse.rinaSakId} mangler bruker og settes på vent"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ internal open class JournalforingTestBase {
kravInitialiseringsService = kravService,
gcpStorageService = gcpStorageService,
statistikkPublisher = statistikkPublisher,
vurderBrukerInfo = vurderBrukerInfo
vurderBrukerInfo = vurderBrukerInfo,
env = null
)

protected val personService: PersonService = mockk(relaxed = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ abstract class JournalforingServiceBase {
kravService,
gcpStorageService,
statistikkPublisher,
mockk(relaxed = true)
mockk(relaxed = true),
env = null
)

protected val opprettJournalpostRequestCapturingSlot = slot<OpprettJournalpostRequest>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ class JournalforingServiceMedGCPTest {
mockk(),
gcpStorageService,
statistikkPublisher,
vurderBrukerInfo
vurderBrukerInfo,
env = null
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class OpprettJournalpostUkjentBrukerTest {
pdfService = mockk(),
kravInitialiseringsService = mockk(),
statistikkPublisher = mockk(),
vurderBrukerInfo = mockk()
vurderBrukerInfo = mockk(),
env = null
)

opprettJournalpostUkjentBruker = spyk(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ internal class SedSendtJournalforingMedNavansattTest {
every { it.hentDokumenterOgVedlegg(any(), any(), any()) } returns Pair("1234568", emptyList())
},
oppgaveHandler, mockk(), gcpStorageService, statistikkPublisher,
vurderBrukerInfo
vurderBrukerInfo,
env = null
)

private val sedListener = SedSendtListener(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ internal class SedSendtJournalforingTest {
mockk(),
gcpStorageService,
statistikkPublisher,
journalforingutenbruker
journalforingutenbruker,
env = null
)

private val sedListener = SedSendtListener(
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/application-integrationtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ KAFKA_KRAVINIT_TOPIC: 'eessi-pensjon-krav-q'
KAFKA_AUTOMATISERING_TOPIC: 'eessi-pensjon-auto'
AZURE_OPENID_CONFIG_TOKEN_ENDPOINT: "dummy"
AZURE_APP_JWK: "dummy"

ENV: q2
kafka:
sedSendt:
topic: ${KAFKA_SEDSENDT_TOPIC}
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

SPRING_PROFILES_ACTIVE: test

ENV: test
KAFKA_SEDSENDT_TOPIC: 'eessi-basis-sedSendt-v1'
KAFKA_SEDMOTTATT_TOPIC: 'eessi-basis-sedMottatt-v1'
KAFKA_OPPGAVE_TOPIC: 'eessi-pensjon-oppgave-v1'
Expand Down

0 comments on commit 17f3dd1

Please sign in to comment.