diff --git a/.nais/naiserator-dev.yaml b/.nais/naiserator-dev.yaml index 8c440b99..83262524 100644 --- a/.nais/naiserator-dev.yaml +++ b/.nais/naiserator-dev.yaml @@ -71,7 +71,7 @@ spec: - application: digdir-krr-proxy namespace: team-rocket - application: isdialogmote-redis - - application: isdialogmotepdfgen + - application: ispdfgen - application: isnarmesteleder - application: isoppfolgingstilfelle - application: syfobehandlendeenhet diff --git a/.nais/naiserator-prod.yaml b/.nais/naiserator-prod.yaml index a1242c78..5530f01f 100644 --- a/.nais/naiserator-prod.yaml +++ b/.nais/naiserator-prod.yaml @@ -72,7 +72,7 @@ spec: - application: digdir-krr-proxy namespace: team-rocket - application: isdialogmote-redis - - application: isdialogmotepdfgen + - application: ispdfgen - application: isnarmesteleder - application: isoppfolgingstilfelle - application: syfobehandlendeenhet diff --git a/src/main/kotlin/no/nav/syfo/application/ApplicationEnvironment.kt b/src/main/kotlin/no/nav/syfo/application/ApplicationEnvironment.kt index 7efcce1f..4e3b45b1 100644 --- a/src/main/kotlin/no/nav/syfo/application/ApplicationEnvironment.kt +++ b/src/main/kotlin/no/nav/syfo/application/ApplicationEnvironment.kt @@ -42,7 +42,7 @@ data class Environment( val eregUrl: String = getEnvVar("EREG_URL"), val sidecarInitialDelay: Long = getEnvVar("SIDECAR_INITIAL_DELAY", "30000").toLong(), val dokarkivUrl: String = getEnvVar("DOKARKIV_URL"), - val isdialogmotepdfgenUrl: String = "http://isdialogmotepdfgen", + val ispdfgenUrl: String = "http://ispdfgen", val krrClientId: String = getEnvVar("KRR_CLIENT_ID"), val krrUrl: String = getEnvVar("KRR_URL"), val syfobehandlendeenhetClientId: String = getEnvVar("SYFOBEHANDLENDEENHET_CLIENT_ID"), diff --git a/src/main/kotlin/no/nav/syfo/application/api/ApiModule.kt b/src/main/kotlin/no/nav/syfo/application/api/ApiModule.kt index bcc9a5e5..57e2b481 100644 --- a/src/main/kotlin/no/nav/syfo/application/api/ApiModule.kt +++ b/src/main/kotlin/no/nav/syfo/application/api/ApiModule.kt @@ -99,7 +99,7 @@ fun Application.apiModule( cache = cache, ) val pdfGenClient = PdfGenClient( - pdfGenBaseUrl = environment.isdialogmotepdfgenUrl + pdfGenBaseUrl = environment.ispdfgenUrl ) val veilederTilgangskontrollClient = VeilederTilgangskontrollClient( azureAdV2Client = azureAdV2Client, diff --git a/src/main/kotlin/no/nav/syfo/client/pdfgen/DialogmoteHendelsePdfContent.kt b/src/main/kotlin/no/nav/syfo/client/pdfgen/DialogmoteHendelsePdfContent.kt new file mode 100644 index 00000000..cf003908 --- /dev/null +++ b/src/main/kotlin/no/nav/syfo/client/pdfgen/DialogmoteHendelsePdfContent.kt @@ -0,0 +1,7 @@ +package no.nav.syfo.client.pdfgen + +import no.nav.syfo.dialogmote.domain.DocumentComponentDTO + +data class DialogmoteHendelsePdfContent( + val documentComponents: List, +) diff --git a/src/main/kotlin/no/nav/syfo/client/pdfgen/PdfGenClient.kt b/src/main/kotlin/no/nav/syfo/client/pdfgen/PdfGenClient.kt index cc6269d9..b323d07e 100644 --- a/src/main/kotlin/no/nav/syfo/client/pdfgen/PdfGenClient.kt +++ b/src/main/kotlin/no/nav/syfo/client/pdfgen/PdfGenClient.kt @@ -14,19 +14,8 @@ import org.slf4j.Logger import org.slf4j.LoggerFactory class PdfGenClient( - pdfGenBaseUrl: String + private val pdfGenBaseUrl: String ) { - private val avlysningUrl: String - private val endringTidStedUrl: String - private val innkallingUrl: String - private val referatUrl: String - - init { - this.avlysningUrl = "$pdfGenBaseUrl$AVLYSNING_PATH" - this.endringTidStedUrl = "$pdfGenBaseUrl$ENDRING_TIDSTED_PATH" - this.innkallingUrl = "$pdfGenBaseUrl$INNKALLING_PATH" - this.referatUrl = "$pdfGenBaseUrl$REFERAT_PATH" - } private val httpClient = httpClientDefault() @@ -37,7 +26,7 @@ class PdfGenClient( return getPdf( callId = callId, documentComponentDTOList = documentComponentDTOList, - pdfUrl = avlysningUrl, + pdfUrl = "$pdfGenBaseUrl$AVLYSNING_PATH", ) } @@ -48,7 +37,7 @@ class PdfGenClient( return getPdf( callId = callId, documentComponentDTOList = documentComponentDTOList, - pdfUrl = endringTidStedUrl, + pdfUrl = "$pdfGenBaseUrl$ENDRING_TIDSTED_PATH", ) } @@ -59,7 +48,7 @@ class PdfGenClient( return getPdf( callId = callId, documentComponentDTOList = documentComponentDTOList, - pdfUrl = innkallingUrl, + pdfUrl = "$pdfGenBaseUrl$INNKALLING_PATH", ) } @@ -70,7 +59,7 @@ class PdfGenClient( return getPdf( callId = callId, documentComponentDTOList = documentComponentDTOList, - pdfUrl = referatUrl, + pdfUrl = "$pdfGenBaseUrl$REFERAT_PATH", ) } @@ -80,11 +69,13 @@ class PdfGenClient( pdfUrl: String, ): ByteArray? { return try { + val requestBody = + DialogmoteHendelsePdfContent(documentComponents = documentComponentDTOList.sanitizeForPdfGen()) val response: HttpResponse = httpClient.post(pdfUrl) { header(NAV_CALL_ID_HEADER, callId) accept(ContentType.Application.Json) contentType(ContentType.Application.Json) - setBody(documentComponentDTOList.sanitizeForPdfGen()) + setBody(requestBody) } COUNT_CALL_PDFGEN_SUCCESS.increment() response.body() @@ -101,7 +92,7 @@ class PdfGenClient( callId: String, ): ByteArray? { log.error( - "Error while requesting PDF from Isdialogmotepdfgen with {}, {}, {}", + "Error while requesting PDF from ispdfgen with {}, {}, {}", StructuredArguments.keyValue("statusCode", response.status.value.toString()), StructuredArguments.keyValue("url", url), callIdArgument(callId) diff --git a/src/main/kotlin/no/nav/syfo/client/pdfgen/PdfgenMetric.kt b/src/main/kotlin/no/nav/syfo/client/pdfgen/PdfgenMetric.kt index 9484453d..26c90fce 100644 --- a/src/main/kotlin/no/nav/syfo/client/pdfgen/PdfgenMetric.kt +++ b/src/main/kotlin/no/nav/syfo/client/pdfgen/PdfgenMetric.kt @@ -4,16 +4,16 @@ import io.micrometer.core.instrument.Counter import no.nav.syfo.metric.METRICS_NS import no.nav.syfo.metric.METRICS_REGISTRY -const val CALL_PDFGEN_BASE = "${METRICS_NS}_call_isdialogmotepdfgen" +const val CALL_PDFGEN_BASE = "${METRICS_NS}_call_ispdfgen" const val CALL_PDFGEN_SUCCESS = "${CALL_PDFGEN_BASE}_success_count" const val CALL_PDFGEN_FAIL = "${CALL_PDFGEN_BASE}_fail_count" val COUNT_CALL_PDFGEN_SUCCESS: Counter = Counter .builder(CALL_PDFGEN_SUCCESS) - .description("Counts the number of successful calls to Isdialogmotepdfgen") + .description("Counts the number of successful calls to ispdfgen") .register(METRICS_REGISTRY) val COUNT_CALL_PDFGEN_FAIL: Counter = Counter .builder(CALL_PDFGEN_FAIL) - .description("Counts the number of failed calls to Isdialogmotepdfgen") + .description("Counts the number of failed calls to ispdfgen") .register(METRICS_REGISTRY) diff --git a/src/test/kotlin/no/nav/syfo/brev/arbeidstaker/ArbeidstakerBrevApiSpek.kt b/src/test/kotlin/no/nav/syfo/brev/arbeidstaker/ArbeidstakerBrevApiSpek.kt index 8c45d424..139edb35 100644 --- a/src/test/kotlin/no/nav/syfo/brev/arbeidstaker/ArbeidstakerBrevApiSpek.kt +++ b/src/test/kotlin/no/nav/syfo/brev/arbeidstaker/ArbeidstakerBrevApiSpek.kt @@ -2,17 +2,10 @@ package no.nav.syfo.brev.arbeidstaker import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.module.kotlin.readValue -import io.ktor.http.ContentType -import io.ktor.http.HttpHeaders +import io.ktor.http.* import io.ktor.http.HttpHeaders.Authorization -import io.ktor.http.HttpMethod -import io.ktor.http.HttpStatusCode -import io.ktor.server.testing.TestApplicationEngine -import io.ktor.server.testing.handleRequest -import io.ktor.server.testing.setBody +import io.ktor.server.testing.* import io.mockk.* -import java.time.LocalDateTime -import java.util.* import kotlinx.coroutines.runBlocking import no.altinn.schemas.services.intermediary.receipt._2009._10.ReceiptExternal import no.altinn.schemas.services.intermediary.receipt._2009._10.ReceiptStatusEnum @@ -56,6 +49,8 @@ import org.spekframework.spek2.style.specification.describe import redis.clients.jedis.JedisPool import redis.clients.jedis.JedisPoolConfig import redis.clients.jedis.Protocol +import java.time.LocalDateTime +import java.util.* class ArbeidstakerBrevApiSpek : Spek({ val objectMapper: ObjectMapper = configuredJacksonMapper() @@ -696,7 +691,7 @@ class ArbeidstakerBrevApiSpek : Spek({ ) { response.status() shouldBeEqualTo HttpStatusCode.OK val pdfContent = response.byteContent!! - pdfContent shouldBeEqualTo externalMockEnvironment.isdialogmotepdfgenMock.pdfInnkalling + pdfContent shouldBeEqualTo externalMockEnvironment.ispdfgenMock.pdfInnkalling } val urlPdfForReferatNedlasting = "$arbeidstakerBrevApiPath/$createdReferatArbeidstakerBrevUUID$arbeidstakerBrevApiPdfPath" @@ -707,7 +702,7 @@ class ArbeidstakerBrevApiSpek : Spek({ ) { response.status() shouldBeEqualTo HttpStatusCode.OK val pdfContent = response.byteContent!! - pdfContent shouldBeEqualTo externalMockEnvironment.isdialogmotepdfgenMock.pdfReferat + pdfContent shouldBeEqualTo externalMockEnvironment.ispdfgenMock.pdfReferat } } } @@ -842,7 +837,7 @@ class ArbeidstakerBrevApiSpek : Spek({ ) { response.status() shouldBeEqualTo HttpStatusCode.OK val pdfContent = response.byteContent!! - pdfContent shouldBeEqualTo externalMockEnvironment.isdialogmotepdfgenMock.pdfInnkalling + pdfContent shouldBeEqualTo externalMockEnvironment.ispdfgenMock.pdfInnkalling } val urlPdfForReferatNedlasting = @@ -861,7 +856,7 @@ class ArbeidstakerBrevApiSpek : Spek({ ) { response.status() shouldBeEqualTo HttpStatusCode.OK val pdfContent = response.byteContent!! - pdfContent shouldBeEqualTo externalMockEnvironment.isdialogmotepdfgenMock.pdfReferat + pdfContent shouldBeEqualTo externalMockEnvironment.ispdfgenMock.pdfReferat } } } diff --git a/src/test/kotlin/no/nav/syfo/brev/narmesteleder/NarmesteLederBrevSpek.kt b/src/test/kotlin/no/nav/syfo/brev/narmesteleder/NarmesteLederBrevSpek.kt index 39ca43de..33680061 100644 --- a/src/test/kotlin/no/nav/syfo/brev/narmesteleder/NarmesteLederBrevSpek.kt +++ b/src/test/kotlin/no/nav/syfo/brev/narmesteleder/NarmesteLederBrevSpek.kt @@ -2,16 +2,9 @@ package no.nav.syfo.brev.narmesteleder import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.module.kotlin.readValue -import io.ktor.http.ContentType -import io.ktor.http.HttpHeaders -import io.ktor.http.HttpMethod -import io.ktor.http.HttpStatusCode -import io.ktor.server.testing.TestApplicationEngine -import io.ktor.server.testing.handleRequest -import io.ktor.server.testing.setBody +import io.ktor.http.* +import io.ktor.server.testing.* import io.mockk.* -import java.time.LocalDateTime -import java.util.* import kotlinx.coroutines.runBlocking import no.altinn.schemas.services.intermediary.receipt._2009._10.ReceiptExternal import no.altinn.schemas.services.intermediary.receipt._2009._10.ReceiptStatusEnum @@ -59,6 +52,8 @@ import org.spekframework.spek2.style.specification.describe import redis.clients.jedis.JedisPool import redis.clients.jedis.JedisPoolConfig import redis.clients.jedis.Protocol +import java.time.LocalDateTime +import java.util.* object NarmesteLederBrevSpek : Spek({ val objectMapper: ObjectMapper = configuredJacksonMapper() @@ -331,7 +326,7 @@ object NarmesteLederBrevSpek : Spek({ ) { response.status() shouldBeEqualTo HttpStatusCode.OK val pdfContent = response.byteContent!! - pdfContent shouldBeEqualTo externalMockEnvironment.isdialogmotepdfgenMock.pdfInnkalling + pdfContent shouldBeEqualTo externalMockEnvironment.ispdfgenMock.pdfInnkalling } val urlMoteUUIDReferat = "$dialogmoteApiV2Basepath/$createdDialogmoteUUID$dialogmoteApiMoteFerdigstillPath" @@ -428,7 +423,7 @@ object NarmesteLederBrevSpek : Spek({ ) { response.status() shouldBeEqualTo HttpStatusCode.OK val pdfContent = response.byteContent!! - pdfContent shouldBeEqualTo externalMockEnvironment.isdialogmotepdfgenMock.pdfReferat + pdfContent shouldBeEqualTo externalMockEnvironment.ispdfgenMock.pdfReferat } val urlMoteUUIDEndreReferat = "$dialogmoteApiV2Basepath/$createdDialogmoteUUID$dialogmoteApiMoteEndreFerdigstiltPath" diff --git a/src/test/kotlin/no/nav/syfo/dialogmote/api/v2/FerdigstillDialogmoteApiV2AllowVarselMedFysiskBrevSpek.kt b/src/test/kotlin/no/nav/syfo/dialogmote/api/v2/FerdigstillDialogmoteApiV2AllowVarselMedFysiskBrevSpek.kt index 1cebc961..7056e810 100644 --- a/src/test/kotlin/no/nav/syfo/dialogmote/api/v2/FerdigstillDialogmoteApiV2AllowVarselMedFysiskBrevSpek.kt +++ b/src/test/kotlin/no/nav/syfo/dialogmote/api/v2/FerdigstillDialogmoteApiV2AllowVarselMedFysiskBrevSpek.kt @@ -2,17 +2,10 @@ package no.nav.syfo.dialogmote.api.v2 import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.module.kotlin.readValue -import io.ktor.http.ContentType -import io.ktor.http.HttpHeaders +import io.ktor.http.* import io.ktor.http.HttpHeaders.Authorization -import io.ktor.http.HttpMethod -import io.ktor.http.HttpStatusCode -import io.ktor.server.testing.TestApplicationEngine -import io.ktor.server.testing.handleRequest -import io.ktor.server.testing.setBody +import io.ktor.server.testing.* import io.mockk.* -import java.time.LocalDate -import java.util.* import no.altinn.schemas.services.intermediary.receipt._2009._10.ReceiptExternal import no.altinn.schemas.services.intermediary.receipt._2009._10.ReceiptStatusEnum import no.altinn.services.serviceengine.correspondence._2009._10.ICorrespondenceAgencyExternalBasic @@ -39,6 +32,8 @@ import org.amshove.kluent.shouldBeEqualTo import org.amshove.kluent.shouldNotBe import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.describe +import java.time.LocalDate +import java.util.* class FerdigstillDialogmoteApiV2AllowVarselMedFysiskBrevSpek : Spek({ val objectMapper: ObjectMapper = configuredJacksonMapper() @@ -182,7 +177,7 @@ class FerdigstillDialogmoteApiV2AllowVarselMedFysiskBrevSpek : Spek({ val pdf = pdfService.getPdf(database.getReferat(UUID.fromString(referat.uuid)).first().pdfId!!) - pdf shouldBeEqualTo externalMockEnvironment.isdialogmotepdfgenMock.pdfReferat + pdf shouldBeEqualTo externalMockEnvironment.ispdfgenMock.pdfReferat val moteStatusEndretList = database.getMoteStatusEndretNotPublished() moteStatusEndretList.size shouldBeEqualTo 2 diff --git a/src/test/kotlin/no/nav/syfo/dialogmote/api/v2/FerdigstillDialogmoteApiV2Spek.kt b/src/test/kotlin/no/nav/syfo/dialogmote/api/v2/FerdigstillDialogmoteApiV2Spek.kt index 19f0a79f..5607ee23 100644 --- a/src/test/kotlin/no/nav/syfo/dialogmote/api/v2/FerdigstillDialogmoteApiV2Spek.kt +++ b/src/test/kotlin/no/nav/syfo/dialogmote/api/v2/FerdigstillDialogmoteApiV2Spek.kt @@ -2,16 +2,10 @@ package no.nav.syfo.dialogmote.api.v2 import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.module.kotlin.readValue -import io.ktor.http.ContentType -import io.ktor.http.HttpHeaders +import io.ktor.http.* import io.ktor.http.HttpHeaders.Authorization -import io.ktor.http.HttpMethod -import io.ktor.http.HttpStatusCode -import io.ktor.server.testing.TestApplicationEngine -import io.ktor.server.testing.handleRequest -import io.ktor.server.testing.setBody +import io.ktor.server.testing.* import io.mockk.* -import java.util.* import no.altinn.schemas.services.intermediary.receipt._2009._10.ReceiptExternal import no.altinn.schemas.services.intermediary.receipt._2009._10.ReceiptStatusEnum import no.altinn.services.serviceengine.correspondence._2009._10.ICorrespondenceAgencyExternalBasic @@ -42,6 +36,7 @@ import org.amshove.kluent.shouldContain import org.amshove.kluent.shouldNotBeEqualTo import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.describe +import java.util.* class FerdigstillDialogmoteApiV2Spek : Spek({ @@ -163,7 +158,7 @@ class FerdigstillDialogmoteApiV2Spek : Spek({ val pdf = pdfService.getPdf(database.getReferat(UUID.fromString(referat.uuid)).first().pdfId!!) - pdf shouldBeEqualTo externalMockEnvironment.isdialogmotepdfgenMock.pdfReferat + pdf shouldBeEqualTo externalMockEnvironment.ispdfgenMock.pdfReferat val moteStatusEndretList = database.getMoteStatusEndretNotPublished() moteStatusEndretList.size shouldBeEqualTo 2 diff --git a/src/test/kotlin/no/nav/syfo/testhelper/ExternalMockEnvironment.kt b/src/test/kotlin/no/nav/syfo/testhelper/ExternalMockEnvironment.kt index f1ccc666..cfb5b991 100644 --- a/src/test/kotlin/no/nav/syfo/testhelper/ExternalMockEnvironment.kt +++ b/src/test/kotlin/no/nav/syfo/testhelper/ExternalMockEnvironment.kt @@ -4,6 +4,7 @@ import io.ktor.server.netty.* import no.nav.common.KafkaEnvironment import no.nav.syfo.application.ApplicationState import no.nav.syfo.testhelper.mock.* +import java.util.* class ExternalMockEnvironment private constructor() { val applicationState: ApplicationState = testAppState() @@ -13,7 +14,7 @@ class ExternalMockEnvironment private constructor() { val tokendingsMock = TokendingsMock() val dokarkivMock = DokarkivMock() val pdlMock = PdlMock() - val isdialogmotepdfgenMock = IsdialogmotepdfgenMock() + val ispdfgenMock = ispdfgenMock() val isoppfolgingstilfelleMock = IsoppfolgingstilfelleMock() val eregMock = EregMock() val krrMock = KrrMock() @@ -25,7 +26,7 @@ class ExternalMockEnvironment private constructor() { azureAdV2Mock.name to azureAdV2Mock.server, tokendingsMock.name to tokendingsMock.server, dokarkivMock.name to dokarkivMock.server, - isdialogmotepdfgenMock.name to isdialogmotepdfgenMock.server, + ispdfgenMock.name to ispdfgenMock.server, isoppfolgingstilfelleMock.name to isoppfolgingstilfelleMock.server, eregMock.name to eregMock.server, krrMock.name to krrMock.server, @@ -40,7 +41,7 @@ class ExternalMockEnvironment private constructor() { azureTokenEndpoint = azureAdV2Mock.url, tokenxEndpoint = tokendingsMock.url, dokarkivUrl = dokarkivMock.url, - isdialogmotepdfgenUrl = isdialogmotepdfgenMock.url, + ispdfgenUrl = ispdfgenMock.url, isoppfolgingstilfelleUrl = isoppfolgingstilfelleMock.url, eregUrl = eregMock.url, krrUrl = krrMock.url, diff --git a/src/test/kotlin/no/nav/syfo/testhelper/TestEnvironment.kt b/src/test/kotlin/no/nav/syfo/testhelper/TestEnvironment.kt index 984a34b8..65a41f30 100644 --- a/src/test/kotlin/no/nav/syfo/testhelper/TestEnvironment.kt +++ b/src/test/kotlin/no/nav/syfo/testhelper/TestEnvironment.kt @@ -1,6 +1,9 @@ package no.nav.syfo.testhelper -import no.nav.syfo.application.* +import io.ktor.utils.io.core.* +import no.nav.syfo.application.ApplicationEnvironmentKafka +import no.nav.syfo.application.ApplicationState +import no.nav.syfo.application.Environment import java.net.ServerSocket import java.time.LocalDate @@ -9,7 +12,7 @@ fun testEnvironment( dokarkivUrl: String = "http://dokarkiv", azureTokenEndpoint: String = "azureTokenEndpoint", tokenxEndpoint: String = "tokenxEndpoint", - isdialogmotepdfgenUrl: String? = null, + ispdfgenUrl: String? = null, isoppfolgingstilfelleUrl: String = "isoppfolgingstilfelle", eregUrl: String = "ereg", krrUrl: String = "krr", @@ -51,7 +54,7 @@ fun testEnvironment( isdialogmoteDbUsername = "username", isdialogmoteDbPassword = "password", dokarkivUrl = dokarkivUrl, - isdialogmotepdfgenUrl = isdialogmotepdfgenUrl ?: "http://isdialogmotepdfgen", + ispdfgenUrl = ispdfgenUrl ?: "http://ispdfgen", krrClientId = "dev-gcp.team-rocket.digdir-krr-proxy", krrUrl = krrUrl, syfobehandlendeenhetClientId = "syfobehandlendeenhetClientId", diff --git a/src/test/kotlin/no/nav/syfo/testhelper/mock/IsdialogmotepdfgenMock.kt b/src/test/kotlin/no/nav/syfo/testhelper/mock/ispdfgenMock.kt similarity index 91% rename from src/test/kotlin/no/nav/syfo/testhelper/mock/IsdialogmotepdfgenMock.kt rename to src/test/kotlin/no/nav/syfo/testhelper/mock/ispdfgenMock.kt index 2e2d179d..6c95da10 100644 --- a/src/test/kotlin/no/nav/syfo/testhelper/mock/IsdialogmotepdfgenMock.kt +++ b/src/test/kotlin/no/nav/syfo/testhelper/mock/ispdfgenMock.kt @@ -15,7 +15,7 @@ import no.nav.syfo.client.pdfgen.PdfGenClient.Companion.REFERAT_PATH import no.nav.syfo.testhelper.getRandomPort import no.nav.syfo.util.configure -class IsdialogmotepdfgenMock { +class ispdfgenMock { private val port = getRandomPort() val url = "http://localhost:$port" @@ -24,12 +24,12 @@ class IsdialogmotepdfgenMock { val pdfInnkalling = byteArrayOf(0x2E, 0x28) val pdfReferat = byteArrayOf(0x2E, 0x27) - val name = "isdialogmotepdfgen" - val server = mockIsdialogmotepdfgenServer( + val name = "ispdfgen" + val server = mockIspdfgenServer( port ) - private fun mockIsdialogmotepdfgenServer( + private fun mockIspdfgenServer( port: Int ): NettyApplicationEngine { return embeddedServer(