Skip to content
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

Merged
merged 12 commits into from
Oct 4, 2024
Merged

Ta i bruk Oppgaveclient #598

merged 12 commits into from
Oct 4, 2024

Conversation

mettok
Copy link
Contributor

@mettok mettok commented Oct 1, 2024

Bruker Oppgave-client for å opprette/hente oppgaver.

@mettok mettok requested a review from a team as a code owner October 1, 2024 12:43
listOf(Oppgave(id = 1, oppgavetype = Oppgavetype.INNTEKTSMELDING, prioritet = Prioritet.NORM.name, aktivDato = LocalDate.now())),
)
val result = oppgaveService.opprettFordelingsOppgave(journalpostId)
verify(exactly = 0) {
Copy link
Contributor

@b162214 b162214 Oct 2, 2024

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)
Copy link
Contributor

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)
Copy link
Contributor

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) }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jeg liker chaining 👯‍♂️ :D

@mettok mettok requested a review from b162214 October 3, 2024 14:11
Copy link
Contributor

@b162214 b162214 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@mettok mettok merged commit 7eca5a5 into master Oct 4, 2024
3 checks passed
@mettok mettok deleted the oppgaveclient branch October 4, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants