-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FAGSYSTEM-338819: For omgjøring etter klage blir behandlinga av type …
…endring, altså heilt vanleg, så da vil ikkje fiksen frå forrige forsøk slå til. Så for revurderingar som er omgjøring etter klage, må vi hente ut klagen og sende med (#5396)
- Loading branch information
1 parent
70349ce
commit 9c8e761
Showing
5 changed files
with
116 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...rc/test/kotlin/no/nav/etterlatte/brev/hentinformasjon/behandling/BehandlingServiceTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package no.nav.etterlatte.brev.hentinformasjon.behandling | ||
|
||
import io.mockk.coEvery | ||
import io.mockk.mockk | ||
import kotlinx.coroutines.runBlocking | ||
import no.nav.etterlatte.brev.behandlingklient.BehandlingKlient | ||
import no.nav.etterlatte.ktor.token.simpleSaksbehandler | ||
import no.nav.etterlatte.libs.common.behandling.Formkrav | ||
import no.nav.etterlatte.libs.common.behandling.FormkravMedBeslutter | ||
import no.nav.etterlatte.libs.common.behandling.JaNei | ||
import no.nav.etterlatte.libs.common.behandling.Klage | ||
import no.nav.etterlatte.libs.common.behandling.KlageStatus | ||
import no.nav.etterlatte.libs.common.behandling.SakType | ||
import no.nav.etterlatte.libs.common.behandling.VedtaketKlagenGjelder | ||
import no.nav.etterlatte.libs.common.grunnlag.Grunnlagsopplysning | ||
import no.nav.etterlatte.libs.common.sak.Sak | ||
import no.nav.etterlatte.libs.common.tidspunkt.Tidspunkt | ||
import no.nav.etterlatte.libs.common.vedtak.VedtakType | ||
import org.junit.jupiter.api.Assertions.assertEquals | ||
import org.junit.jupiter.api.Test | ||
import java.time.ZonedDateTime | ||
import java.util.UUID | ||
|
||
class BehandlingServiceTest { | ||
@Test | ||
fun `kan hente og deserialisere klager`() { | ||
val behandlingId = UUID.randomUUID() | ||
val klagePaaDenneBehandlinga = klage(behandlingId, 1L) | ||
val klient = | ||
mockk<BehandlingKlient>().also { | ||
coEvery { it.hentKlagerForSak(1L, any()) } returns | ||
listOf( | ||
klagePaaDenneBehandlinga, | ||
klage(UUID.randomUUID(), 2L), | ||
) | ||
} | ||
val service = BehandlingService(klient) | ||
runBlocking { | ||
val klage = service.hentKlageForBehandling(behandlingId, 1L, simpleSaksbehandler()) | ||
assertEquals(klagePaaDenneBehandlinga, klage) | ||
} | ||
} | ||
|
||
private fun klage( | ||
behandlingId: UUID, | ||
sakId: Long, | ||
): Klage = | ||
Klage( | ||
behandlingId, | ||
Sak("ident", SakType.BARNEPENSJON, sakId, "einheit"), | ||
Tidspunkt.now(), | ||
KlageStatus.OPPRETTET, | ||
kabalResultat = null, | ||
kabalStatus = null, | ||
formkrav = | ||
FormkravMedBeslutter( | ||
Formkrav( | ||
vedtaketKlagenGjelder = | ||
VedtaketKlagenGjelder( | ||
id = UUID.randomUUID().toString(), | ||
behandlingId = behandlingId.toString(), | ||
datoAttestert = ZonedDateTime.now(), | ||
vedtakType = VedtakType.ENDRING, | ||
), | ||
erKlagerPartISaken = JaNei.JA, | ||
erKlagenSignert = JaNei.JA, | ||
gjelderKlagenNoeKonkretIVedtaket = JaNei.JA, | ||
erKlagenFramsattInnenFrist = JaNei.JA, | ||
erFormkraveneOppfylt = JaNei.JA, | ||
begrunnelse = "klage", | ||
), | ||
saksbehandler = Grunnlagsopplysning.automatiskSaksbehandler, | ||
), | ||
innkommendeDokument = null, | ||
resultat = null, | ||
utfall = null, | ||
aarsakTilAvbrytelse = null, | ||
initieltUtfall = null, | ||
) | ||
} |