-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58ec7c9
commit 889e962
Showing
4 changed files
with
62 additions
and
6 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
39 changes: 39 additions & 0 deletions
39
src/test/kotlin/no/nav/syfo/oppgave/service/UpdateStatusServiceDbTest.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,39 @@ | ||
package no.nav.syfo.oppgave.service | ||
|
||
import io.kotest.core.spec.style.FunSpec | ||
import io.mockk.coEvery | ||
import io.mockk.mockk | ||
import io.mockk.mockkStatic | ||
import no.nav.syfo.db.DatabaseInterface | ||
import no.nav.syfo.model.ManuellOppgave | ||
import no.nav.syfo.model.Status | ||
import no.nav.syfo.model.ValidationResult | ||
import no.nav.syfo.oppgave.client.OppgaveClient | ||
import no.nav.syfo.persistering.db.opprettManuellOppgave | ||
import no.nav.syfo.testutil.TestDB | ||
import no.nav.syfo.testutil.okApprec | ||
import no.nav.syfo.testutil.receivedSykmelding | ||
import java.util.UUID | ||
|
||
class UpdateStatusServiceDbTest : FunSpec({ | ||
val database: DatabaseInterface = TestDB.database | ||
val oppgaveClient: OppgaveClient = mockk() | ||
val service: UpdateStatusService = UpdateStatusService(database, oppgaveClient) | ||
mockkStatic("no.nav.syfo.persistering.db.PersisterManuellOppgaveQueriesKt") | ||
coEvery { oppgaveClient.hentOppgave(any(), any()) } returns null | ||
beforeTest { | ||
database.opprettManuellOppgave( | ||
manuellOppgave = ManuellOppgave( | ||
receivedSykmelding = receivedSykmelding(UUID.randomUUID().toString()), | ||
validationResult = ValidationResult(Status.OK, emptyList()), | ||
apprec = okApprec(), | ||
), | ||
okApprec(), | ||
0, | ||
) | ||
} | ||
|
||
test("Update status") { | ||
service.start() | ||
} | ||
}) |