Skip to content

Commit

Permalink
Diverse små kosmetiske fikser
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Kroken committed Oct 4, 2023
1 parent 9d3f7f9 commit acf0d39
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Kaller BA system som begynner opplasting av barnetrygd for år til topic
1) Gå til endepunktet du ønsker å kalle.
2) Logg inn med trygdeetaten mailen din.
3) Om du ikke får logget inn: sørg for at du er medlem av gruppen pensjonopptjeningtest i azureAd test tennant(trygdeetaten.no)
2) Applikasjonen skal etter innloggin autmoatisk videresende deg til urlen du skrev inn.
4) Applikasjonen skal etter innloggin autmoatisk videresende deg til urlen du skrev inn.

## Lokalt oppsett
Start docker daemon eller colima
Expand Down
6 changes: 4 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ val jacksonVersion = "2.15.2"
val springKafkaTestVersion = "3.0.11"
val azureAdClient = "0.0.7"
val assertjVersion = "3.24.2"
val awaitilityVersion = "4.2.0"
val wiremockVersion = "3.2.0"

plugins {
kotlin("jvm") version "1.9.10"
Expand Down Expand Up @@ -71,8 +73,8 @@ dependencies {
testImplementation("org.springframework.kafka:spring-kafka-test:$springKafkaTestVersion")
testImplementation("org.mockito.kotlin:mockito-kotlin:5.1.0")
testImplementation("org.assertj:assertj-core:$assertjVersion")
testImplementation("org.awaitility:awaitility:4.2.0")
testImplementation("org.wiremock:wiremock:3.2.0")
testImplementation("org.awaitility:awaitility:$awaitilityVersion")
testImplementation("org.wiremock:wiremock:$wiremockVersion")
}

tasks.test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BarnetrygdmottakerProcessingThread(
) : Runnable {

companion object {
val log = LoggerFactory.getLogger(this::class.java)
val log = LoggerFactory.getLogger(this::class.java)!!
}

@PostConstruct
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
package no.nav.pensjon.opptjening.omsorgsopptjening.start.innlesning.barnetrygd.web

import com.google.gson.JsonObject
import io.micrometer.core.instrument.MeterRegistry
import io.micrometer.core.instrument.binder.hystrix.MicrometerMetricsPublisher
import no.nav.pensjon.opptjening.omsorgsopptjening.felles.mapToJson
import no.nav.pensjon.opptjening.omsorgsopptjening.start.innlesning.barnetrygd.domain.BarnetrygdmottakerService
import no.nav.pensjon.opptjening.omsorgsopptjening.start.innlesning.barnetrygd.domain.StatusRapporteringsService
import no.nav.security.token.support.core.api.Protected
import no.nav.security.token.support.core.api.Unprotected
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RestController

@RestController
@Unprotected
class PrometheusWebApi(
private val barnetrygdService: BarnetrygdmottakerService,
private val registry: MeterRegistry
) {
companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ class EndToEndTest : SpringContextTest.WithKafka() {
private lateinit var webApi: BarnetrygdWebApi

companion object {
@JvmField
@RegisterExtension
private val wiremock = WireMockExtension.newInstance()
val wiremock = WireMockExtension.newInstance()
.options(WireMockConfiguration.wireMockConfig().port(WIREMOCK_PORT))
.build()!!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ class BarnetrygdmottakerServiceTest : SpringContextTest.NoKafka() {
private lateinit var innlesingRepository: BarnetrygdInnlesingRepository

companion object {
@JvmField
@RegisterExtension
private val wiremock = WireMockExtension.newInstance()
val wiremock = WireMockExtension.newInstance()
.options(WireMockConfiguration.wireMockConfig().port(WIREMOCK_PORT))
.build()!!
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class MicrometerStatusMalereTest {
målere.oppdater(ApplicationStatus.OK)
målere.oppdater(ApplicationStatus.OK)
målere.oppdater(ApplicationStatus.OK)
val okCount = registry.get("pensjonopptjening_ªapplikasjonsstatus_ok").gauge().value().toInt()
val okCount = registry.get("pensjonopptjening_applikasjonsstatus_ok").gauge().value().toInt()
assertThat(okCount).isOne()
}

Expand All @@ -85,6 +85,4 @@ class MicrometerStatusMalereTest {
println("Mangler: $manglerCount")
assertThat(manglerCount).isOne()
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ class BarnetrygdClientTest : SpringContextTest.NoKafka() {
private lateinit var client: BarnetrygdClient

companion object {
@JvmField
@RegisterExtension
private val wiremock = WireMockExtension.newInstance()
val wiremock = WireMockExtension.newInstance()
.options(WireMockConfiguration.wireMockConfig().port(WIREMOCK_PORT))
.build()!!
}
Expand Down

0 comments on commit acf0d39

Please sign in to comment.