-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ta i bruk Oppgaveclient #598
Conversation
listOf(Oppgave(id = 1, oppgavetype = Oppgavetype.INNTEKTSMELDING, prioritet = Prioritet.NORM.name, aktivDato = LocalDate.now())), | ||
) | ||
val result = oppgaveService.opprettFordelingsOppgave(journalpostId) | ||
verify(exactly = 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kanskje endre navnet på testen til at det gjelder fordelingsoppgave.
Kan også bytte til coVerify uten runblocking
coEvery { oppgaveClient.opprettOppgave(any()) } returns OpprettOppgaveResponse(1) | ||
coEvery { metrikk.tellOpprettOppgave(any()) } just Runs | ||
|
||
val result = oppgaveService.opprettOppgave(journalpostId, aktoerId, behandlingsKategori) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tenker det er greit å teste alle ulike casene for opprettelse av oppgave også.
så her kan man feks gjøre
coVerify { oppgaveClient.opprettOppgave(match { it.journalpostId == journalpostId && it.aktoerId == aktoerId && it.behandlingstype == "ae0106" && it.behandlingstema == null }) }
journalpostId: String, | ||
): OppgaveResultat? { | ||
try { | ||
val oppgaveResponse = hentOppgave(oppgavetype = oppgavetype, journalpostId = journalpostId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bare litt preferanse om man liker chaining eller ikke, men hva med
return oppgaveResponse .oppgaver .firstOrNull() ?.id ?.let { OppgaveResultat(it, true, false) }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jeg liker chaining 👯♂️ :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
Bruker Oppgave-client for å opprette/hente oppgaver.