Skip to content

Commit

Permalink
R - Sletter ubrukt endepunkt /rinasaker/joark/{aktoerId}/pesyssak/{sa…
Browse files Browse the repository at this point in the history
…knr}
  • Loading branch information
MariamPervez committed Nov 8, 2023
1 parent 2d2fdfd commit 265a7c8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 71 deletions.
42 changes: 0 additions & 42 deletions src/main/kotlin/no/nav/eessi/pensjon/fagmodul/api/BucController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -183,48 +183,6 @@ class BucController(
}
}

/**
* Rina-saker der det finnes journalførte dokumenter
*/
@Deprecated("Bruk hentBucerMedJournalforteSeder()")
@GetMapping("/rinasaker/joark/{aktoerId}/pesyssak/{saknr}")
fun getRinasakerJoark(
@PathVariable("aktoerId", required = true) aktoerId: String,
@PathVariable("saknr", required = false) pensjonSakNummer: String
): List<EuxInnhentingService.BucView> {
return bucViewJoark.measure {

logger.info("henter rinasaker på valgt aktoerid: $aktoerId, på saknr: $pensjonSakNummer")

val (rinaSakIderFraJoark, hentRinaSakerForJoarkTid) = measureTimedValue {
innhentingService.hentRinaSakIderFraJoarksMetadata(aktoerId)
}.also { logger.debug("rinaSakIderFraJoark : ${it.value}")}

//saker fra saf og eux/rina
val (safView, hentBucViewsVarighet) = measureTimedValue {
euxInnhentingService.lagBucViews(
aktoerId,
pensjonSakNummer,
rinaSakIderFraJoark,
EuxInnhentingService.BucViewKilde.SAF
)
}.also { logger.debug("safView : ${it.toJson()}") }

//return med sort og distict (avdodfmr og caseid)
return@measure safView.sortedByDescending { it.avdodFnr }.distinctBy { it.euxCaseId }
.also {
logger.info(
"""
GetRinasakerJoark
SafView størrelse: ${it.size}
hentRinaSakIderFraJoarksMetadata: ${hentRinaSakerForJoarkTid.inWholeSeconds}
hentBucViews: ${hentBucViewsVarighet.inWholeSeconds}
""".trimIndent()
)
}
}
}

/**
* Liste med buc'er for aktør & pesys-sakssnr - som det finnes journalførte dokumenter på
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,35 +331,6 @@ internal class BucControllerIT: BucBaseTest() {
JSONAssert.assertEquals(response, expected, false)
}

@Test
fun `Hent mulige rinasaker for aktoer uten vedtak og saf`() {
val aktoerId = "1123123123123123"
val pesysSaknr = "100001000"

val httpEntity = dummyHeader(dummySafReqeust(aktoerId))
every { restSafTemplate.exchange(eq("/"), eq(HttpMethod.POST), eq(httpEntity), eq(String::class.java)) } returns ResponseEntity.ok().body( dummySafMetaResponseMedRina( "5195021", "5922554" ) )

every { euxNavIdentRestTemplate.exchange( "/buc/5922554", HttpMethod.GET, null, String::class.java) } returns ResponseEntity.ok().body( Buc(id = "5922554", processDefinitionName = "P_BUC_03").toJson() )
every { euxNavIdentRestTemplate.exchange( "/buc/5195021", HttpMethod.GET, null, String::class.java) } returns ResponseEntity.ok().body( Buc(id = "5195021", processDefinitionName = "P_BUC_03").toJson() )

val result = mockMvc.perform(
get("/buc/rinasaker/joark/$aktoerId/pesyssak/$pesysSaknr")
.contentType(MediaType.APPLICATION_JSON))
.andExpect(MockMvcResultMatchers.status().isOk)
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON_VALUE))
.andReturn()

val response = result.response.getContentAsString(charset("UTF-8"))

val expected = """
[{"euxCaseId":"5195021","buctype":"P_BUC_03","aktoerId":"1123123123123123","saknr":"100001000","avdodFnr":null,"kilde":"SAF"},
{"euxCaseId":"5922554","buctype":"P_BUC_03","aktoerId":"1123123123123123","saknr":"100001000","avdodFnr":null,"kilde":"SAF"}]
""".trimIndent()

JSONAssert.assertEquals(expected, response, false)

}

@Test
fun `Hent mulige rinasaker for fnr fra euxrina`() {
val fnr = "1234567890000"
Expand Down

0 comments on commit 265a7c8

Please sign in to comment.