Skip to content

Commit

Permalink
Basic integrasjonstest
Browse files Browse the repository at this point in the history
  • Loading branch information
RettIProd committed Oct 25, 2023
1 parent e123d03 commit 6752da1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions ebms-provider/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ dependencies {
implementation("com.sun.xml.messaging.saaj:saaj-impl:3.0.2")
//implementation("org.glassfish.jaxb:jaxb-runtime:4.0.3") // TODO: Latest. Krever at protokoll oppdateres
implementation(libs.ebxml.protokoll)
testImplementation(testLibs.ktor.server.test.host)
testImplementation(testLibs.junit.jupiter.api)
testImplementation(testLibs.mockk.jvm)
testImplementation(testLibs.mockk.dsl.jvm)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package no.nav.emottak.ebms

import io.ktor.client.request.get
import io.ktor.client.request.headers
import io.ktor.client.request.post
import io.ktor.client.request.setBody
import io.ktor.client.statement.bodyAsText
import io.ktor.http.HttpStatusCode
import io.ktor.server.testing.testApplication
import no.nav.emottak.ebms.validation.MimeHeaders
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import java.nio.channels.UnresolvedAddressException

class IntegrasjonsTest {

@Test
fun basicEndpointTest() = testApplication {
application { myApplicationModule() }
val response = client.get("/")
Assertions.assertEquals(HttpStatusCode.OK, response.status)
Assertions.assertEquals("Hello, world!", response.bodyAsText())
}

@Test
fun testEbmsEndpoint() = testApplication { application { myApplicationModule() }

val EXAMPLE_BODY = "------=_Part_495_-1172936255.1665395092859\r\nContent-Type: text/xml\r\nContent-Transfer-Encoding: base64\r\nContent-ID: <soapId-6ae68a32-8b0e-4de2-baad-f4d841aacce1>\r\n\r\nPFNPQVA6RW52ZWxvcGUgeG1sbnM6U09BUD0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29h\r\ncC9lbnZlbG9wZS8iIHhtbG5zOmViPSJodHRwOi8vd3d3Lm9hc2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haWlR4\r\nQVdDWDMvLzNXbEtqMk1udk4xR0JZK3NjUDk4RjRoM0dyTFBiMEN3RHJJWVJrZDJhYlNHVUhUZXRo\r\nV1lNamtRbVp6YkVDQk45K1Z1cnpaY0VyUVhKMm9XcHF2aW1PYkJWUW5hc1ZZRjkvWE5KZlBnNVBP\r\nUGJoU3BsQ0pxRzFCcWpyODdudmFmM1RSdz09PC9Nb2R1bHVzPjxFeHBvbmVudD5BUUFCPC9FeHBv\r\nbmVudD48L1JTQUtleVZhbHVlPjwvS2V5VmFsdWU+PC9LZXlJbmZvPjwvU2lnbmF0dXJlPjwvU09B\r\nUDpIZWFkZXI+PFNPQVA6Qm9keT48ZWI6TWFuaWZlc3QgZWI6dmVyc2lvbj0iMi4wIj48ZWI6UmVm\r\nZXJlbmNlIHhsaW5rOmhyZWY9ImNpZDphdHRhY2htZW50SWQtMDIyZmFmMjYtMGUxMi00ZGZlLWE1\r\nOWItYjUwNjEzMmYxNjQ1Ij48L2ViOlJlZmVyZW5jZT48L2ViOk1hbmlmZXN0PjwvU09BUDpCb2R5\r\nPjwvU09BUDpFbnZlbG9wZT4=\r\n------=_Part_495_-1172936255.1665395092859\r\nContent-Type: application/pkcs7-mime\r\nContent-Id: <attachmentId-022faf26-0e12-4dfe-a59b-b506132f1645>\r\nContent-Disposition: attachment\r\nContent-Transfer-Encoding: base64\r\n\r\nPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48bnM6TXNnSGVhZCB4bWxuczp4\r\nc2Q9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93\r\nd3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4bWxuczpucz0iaHR0cDovL3d3dy5r\r\naXRoLm5vL3htbHN0ZHMvbXNnaGVhZC8yMDA2LTA1LTI0IiB4c2k6c2NoZW1hTG9jYXRpb249Imh0\r\ndHA6Ly93d3cua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b25uZWN0aW9uIFY9IkgiIEROPSJIb3ZlZGRva3VtZW50\r\nIiAvPgogICAgPG5zOlJlZkRvYz4KICAgICAgPG5zOk1zZ1R5cGUgVj0iWE1MIiBETj0iWE1MLWlu\r\nc3RhbnMiIC8+CiAgICAgIDxuczpDb250ZW50PgogICAgICAgIDxFZ2VuYW5kZWxGb3Jlc3BvcnNl\r\nbFYyIHhtbG5zPSJodHRwOi8vd3d3LmtpdGgubm8veG1sc3Rkcy9uYXYvZWdlbmFuZGVsLzIwMTYt\r\nMDYtMTAiPgogICAgICAgICAgPEhhckJvcmdlckVnZW5hbmRlbGZyaXRhaz4KICAgICAgICAgICAg\r\nPEJvcmdlckZucj4xMTAxNzMxOTQzNjwvQm9yZ2VyRm5yPgogICAgICAgICAgICA8RGF0bz4yMDIy\r\nLTEwLTEwPC9EYXRvPgogICAgICAgICAgPC9IYXJCb3JnZXJFZ2VuYW5kZWxmcml0YWs+CiAgICAg\r\nICAgPC9FZ2VuYW5kZWxGb3Jlc3BvcnNlbFYyPgogICAgICA8L25zOkNvbnRlbnQ+CiAgICA8L25z\r\nOlJlZkRvYz4KICA8L25zOkRvY3VtZW50Pgo8L25zOk1zZ0hlYWQ+\r\n\r\n------=_Part_495_-1172936255.1665395092859--"
val MULTIPART_CONTENT_TYPE = """multipart/related;type="text/xml";boundary="----=_Part_495_-1172936255.1665395092859";start="<soapId-6ae68a32-8b0e-4de2-baad-f4d841aacce1>";"""
try {
val response = client.post("/ebms") {
headers {
append(MimeHeaders.MIME_VERSION, "1.0")
append(MimeHeaders.SOAP_ACTION, "ebXML")
append(MimeHeaders.CONTENT_TYPE, MULTIPART_CONTENT_TYPE)
}
setBody(EXAMPLE_BODY)
}
} catch (e: UnresolvedAddressException) {
// TODO test burde på sikt representere grønt løp for en melding.
}
//assertEquals(HttpStatusCode.OK, response.status)
//assertEquals("Hello, world!", response.bodyAsText())
}

}
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ dependencyResolutionManagement {
version("mockk", "1.13.8")
version("testPostgres","1.18.0")
version("xmlunit", "2.9.1")
version("ktor-server-test", "2.3.4")

library("ktor-server-test-host", "io.ktor", "ktor-server-test-host").versionRef("ktor-server-test")
library("junit-jupiter-api", "org.junit.jupiter", "junit-jupiter-api").versionRef("junit")
library("junit-jupiter-engine", "org.junit.jupiter", "junit-jupiter-engine").versionRef("junit")
library("junit-jupiter-params", "org.junit.jupiter", "junit-jupiter-params").versionRef("junit")
Expand Down

0 comments on commit 6752da1

Please sign in to comment.