diff --git a/build.gradle.kts b/build.gradle.kts index 73424f3..83777ab 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,7 +16,7 @@ val junitJupiterVersion = "5.10.1" val verapdfVersion = "1.24.1" val ktfmtVersion = "0.44" val testcontainersVersion= "1.19.1" -val pdfgencoreVersion = "1.0.2" +val pdfgencoreVersion = "1.0.3" plugins { diff --git a/src/test/kotlin/no/nav/pdfgen/RenderingTest.kt b/src/test/kotlin/no/nav/pdfgen/RenderingTest.kt index 7ed2645..1e24617 100644 --- a/src/test/kotlin/no/nav/pdfgen/RenderingTest.kt +++ b/src/test/kotlin/no/nav/pdfgen/RenderingTest.kt @@ -1,14 +1,10 @@ package no.nav.pdfgen -// import no.nav.pdfgen.core.api.render import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.ObjectMapper -import com.github.jknack.handlebars.Context -import com.github.jknack.handlebars.JsonNodeValueResolver -import com.github.jknack.handlebars.context.MapValueResolver import java.io.ByteArrayInputStream -import no.nav.pdfgen.core.HANDLEBARS_RENDERING_SUMMARY import no.nav.pdfgen.core.pdf.createPDFA +import no.nav.pdfgen.core.pdf.render import no.nav.pdfgen.core.template.loadTemplates import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.BeforeEach @@ -101,26 +97,3 @@ internal class RenderingTest { } } } - -// TODO remove this and use pdfgen-core method -fun render(directoryName: String, template: String, jsonNode: JsonNode): String? { - return HANDLEBARS_RENDERING_SUMMARY.startTimer() - .use { - loadTemplates()[directoryName to template]?.apply( - Context.newBuilder(jsonNode) - .resolver( - JsonNodeValueResolver.INSTANCE, - MapValueResolver.INSTANCE, - ) - .build(), - ) - } - ?.let { html -> - /* Uncomment to output html to file for easier debug - * File("pdf.html").bufferedWriter().use { out -> - * out.write(html) - * } - */ - html - } -}