Skip to content

Commit

Permalink
Remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
MalazAlkoj committed Sep 6, 2024
1 parent 037745c commit 6ec67b2
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 27 deletions.
2 changes: 0 additions & 2 deletions src/main/kotlin/no/nav/syfo/aareg/AaregClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class AaregClient(
LOG.info("AaregClient with scope: $scope")
LOG.info("AaregClient with cleanedScope: $cleanedScope")
metrikk.tellHendelse("call_aareg")
// check which function to use for getting token, or we need to use getOnBehalfOfToken
val token = azureAdTokenClient.getSystemToken(cleanedScope)

return try {
Expand All @@ -61,7 +60,6 @@ class AaregClient(
private fun entity(fnr: String, token: String): HttpEntity<*> {
val headers = HttpHeaders()
headers.add(HttpHeaders.AUTHORIZATION, bearerHeader(token))
// headers.add(NAV_CONSUMER_TOKEN_HEADER, bearerHeader(token))
headers.add(NAV_PERSONIDENT_HEADER, fnr)
return HttpEntity<Any>(headers)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ class ArbeidsforholdController(
@RequestParam date: LocalDate,
@RequestParam orgnummer: String
): ResponseEntity<List<Stilling>> {
/*val innloggetFnr =
TokenXUtil.validateTokenXClaims(contextHolder, oppfolgingsplanClientId).fnrFromIdportenTokenX().value
*/
log.info("Henter stillinger for aktorId $aktorId, orgnummer $orgnummer")
val stillinger = arbeidsforholdService.arbeidstakersStillingerForOrgnummer(aktorId, date, orgnummer)
log.info("Hentet ${stillinger.size} stillinger for aktorId $aktorId, orgnummer $orgnummer")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,10 @@ class NarmesteLederController @Autowired constructor(
val innloggetIdent = TokenXUtil.validateTokenXClaims(contextHolder, oppfolgingsplanClientId)
.fnrFromIdportenTokenX()
.value
// Henting og logging av stillinger TO be removed when we use it from where it should be used
LOG.info("Henter stillinger from ArbeidsforholdService for $innloggetIdent")
val stillinger = arbeidsforholdService.arbeidstakersStillinger(innloggetIdent)
LOG.info("Hentet alle stillinger from ArbeidsforholdService for $innloggetIdent: $stillinger")
/*LOG.info("Henter nærmeste leder for $innloggetIdent i virksomhet $virksomhetsnummer")
val stillingerIFlereVirksomhet =
arbeidsforholdService.arbeidstakersStillingerForOrgnummer(fnr, listOf(virksomhetsnummer))
LOG.info("Hentet stillinger for $fnr i virksomhet $virksomhetsnummer: $stillingerIFlereVirksomhet")
LOG.info("Henter stillinger for $fnr i virksomhet $virksomhetsnummer")
val stillingerForVirksomhet = arbeidsforholdService.arbeidstakersStillingerForOrgnummer(
fnr,
LocalDate.now(),
virksomhetsnummer
)
LOG.info(
"Hentet stillinger for $fnr i virksomhet $virksomhetsnummer: $stillingerForVirksomhet from date:" +
"${LocalDate.now()}"
)*/
val narmesteLedere = narmesteLederClient.alleLedereForSykmeldt(ansattFnr = innloggetIdent)
LOG.info("Hentet nærmeste ledere for $innloggetIdent: $narmesteLedere")
LOG.info("Hentet nærmeste ledere for $innloggetIdent: ${narmesteLedere.size}")
Expand Down
6 changes: 0 additions & 6 deletions src/main/kotlin/no/nav/syfo/pdl/PdlClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class PdlClient(
val entity = createRequestEntity(
PdlRequest(query ?: "", Variables(ident = ident, grupper = gruppe))
)
// try {
val pdlIdenter = RestTemplate().exchange(
pdlUrl,
HttpMethod.POST,
Expand All @@ -106,11 +105,6 @@ class PdlClient(
throw RestClientException("Error while requesting $gruppe from PDL")
}
}
/*} catch (exception: RestClientResponseException) {
metric.tellHendelse("call_pdl_fail")
LOG.error("Error from PDL with request-url: $pdlUrl", exception)
throw exception
}*/
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ object AaregClientTestUtils {
val PASSED_DATE: LocalDate = LocalDate.of(1970, 1, 2)
const val YRKESKODE = "1234567"

// Unused code may will be used in ArbeidsforholdSErviceTest
const val YRKESNAVN = "yrkesnavn"
const val YRKESNAVN_CAPITALIZED = "Yrkesnavn"
const val STILLINGSPROSENT = 50.0
Expand All @@ -39,7 +38,6 @@ object AaregClientTestUtils {
)
}

// To be used later in ArbeidsforholdServiceTest
fun validArbeidsforhold(): Arbeidsforhold {
return mockArbeidsforhold(ORGNUMMER, Type.Organisasjon, VALID_DATE)
}
Expand Down

0 comments on commit 6ec67b2

Please sign in to comment.