Skip to content

Commit

Permalink
fikset en test
Browse files Browse the repository at this point in the history
  • Loading branch information
jankroken-nav committed Oct 24, 2024
1 parent be2aaa8 commit 86bab02
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class BarnetrygdinformasjonRepositoryTest(
barnetrygdinformasjonRepository.frigi(locked1)
val locked3 = barnetrygdinformasjonRepository.finnNesteTilBehandling(3)
assertThat(locked3.data).hasSize(3)
assertThat(locked3.data).containsExactlyElementsOf(locked1.data)
assertThat(locked3.data).containsExactlyInAnyOrderElementsOf(locked1.data)
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ private fun WireMockExtension.pdlResponse(fileName: String): StubMapping {
}
}

private fun WireMockExtension.pdlResponse(fnr: String, fileName: String): StubMapping {
synchronized(this) {
return this.stubFor(
WireMock.post(WireMock.urlPathEqualTo("/graphql"))
.withRequestBody(WireMock.containing(""""variables":{"ident":"$fnr"}"""))
.willReturn(
aResponse()
.withHeader("Content-Type", "application/json")
.withStatus(202)
.withBodyFile("pdl/$fileName")
)
)
}
}


fun WireMockExtension.`pdl med ett fnr`(fnr: String): StubMapping {
synchronized(this) {
return this.stubFor(
Expand Down Expand Up @@ -85,6 +101,10 @@ fun WireMockExtension.`pdl error not_found`(): StubMapping {
return this.pdlResponse("error_not_found.json")
}

fun WireMockExtension.`pdl error not_found`(fnr: String): StubMapping {
return this.pdlResponse(fnr, "error_not_found.json")
}

fun WireMockExtension.`pdl server error`(): StubMapping {
return this.pdlResponse("error_server_error.json")
}
Expand Down

0 comments on commit 86bab02

Please sign in to comment.