diff --git a/Dockerfile b/Dockerfile index fc13479..23d58bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM openjdk:11-jre ENV APPLICATION_USER ktor -RUN adduser -D -g '' $APPLICATION_USER +RUN adduser --defaults --gid '' $APPLICATION_USER RUN mkdir /app RUN chown -R $APPLICATION_USER /app diff --git a/build.gradle b/build.gradle index ecd1b13..52d9df5 100644 --- a/build.gradle +++ b/build.gradle @@ -67,4 +67,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { } shadowJar { + baseName = 'output-service-rdb' + classifier = null + version = null } \ No newline at end of file diff --git a/test/ApplicationTest.kt b/test/ApplicationTest.kt deleted file mode 100644 index 41cf109..0000000 --- a/test/ApplicationTest.kt +++ /dev/null @@ -1,30 +0,0 @@ -package com.kmalbz - -import io.ktor.application.* -import io.ktor.response.* -import io.ktor.request.* -import io.ktor.routing.* -import io.ktor.http.* -import io.ktor.gson.* -import io.ktor.features.* -import io.ktor.client.* -import io.ktor.client.engine.apache.* -import io.ktor.auth.* -import kotlin.reflect.* -import java.util.* -import kotlin.test.* -import io.ktor.server.testing.* -import io.ktor.util.KtorExperimentalAPI - -class ApplicationTest { - @KtorExperimentalAPI - @Test - fun testRoot() { - withTestApplication({ module(testing = true) }) { - handleRequest(HttpMethod.Get, "/").apply { - assertEquals(HttpStatusCode.OK, response.status()) - assertEquals("HELLO WORLD!", response.content) - } - } - } -} diff --git a/test/OutputServiceRDBServerTest.kt b/test/OutputServiceRDBServerTest.kt deleted file mode 100644 index 9f60272..0000000 --- a/test/OutputServiceRDBServerTest.kt +++ /dev/null @@ -1,95 +0,0 @@ -package com.kmalbz - -import io.ktor.config.* -import io.ktor.http.* -import io.ktor.server.testing.* -import kotlin.test.* - -class SwaggerRoutesTest { - /** - * @see OutputServiceRDBServer.getallnegative - */ - @Test - fun testGetallnegative() { - withTestApplication { - // @TODO: Adjust path as required - handleRequest(HttpMethod.Get, "/output/filter/negative") { - }.apply { - // @TODO: Your test here - assertEquals(HttpStatusCode.OK, response.status()) - } - } - } - - /** - * @see OutputServiceRDBServer.getallpositive - */ - @Test - fun testGetallpositive() { - withTestApplication { - // @TODO: Adjust path as required - handleRequest(HttpMethod.Get, "/output/filter/positive") { - }.apply { - // @TODO: Your test here - assertEquals(HttpStatusCode.OK, response.status()) - } - } - } - - /** - * @see OutputServiceRDBServer.getallafter - */ - @Test - fun testGetallafter() { - withTestApplication { - // @TODO: Adjust path as required - handleRequest(HttpMethod.Get, "/output/after/{dateAfter}") { - }.apply { - // @TODO: Your test here - assertEquals(HttpStatusCode.OK, response.status()) - } - } - } - - /** - * @see OutputServiceRDBServer.getallbefore - */ - @Test - fun testGetallbefore() { - withTestApplication { - // @TODO: Adjust path as required - handleRequest(HttpMethod.Get, "/output/before/{dateBefore}") { - }.apply { - // @TODO: Your test here - assertEquals(HttpStatusCode.OK, response.status()) - } - } - } - - /** - * @see OutputServiceRDBServer.getDecision - */ - @Test - fun testGetDecision() { - withTestApplication { - // @TODO: Adjust path as required - handleRequest(HttpMethod.Get, "/output/{tagID}") { - }.apply { - // @TODO: Your test here - assertEquals(HttpStatusCode.OK, response.status()) - } - } - } - - fun withTestApplication(test: TestApplicationEngine.() -> R): R { - return withApplication(createTestEnvironment()) { - (environment.config as MapApplicationConfig).apply { - put("jwt.secret", "TODO-change-this-supersecret-or-use-SECRET-env") - } - application.module() - test() - } - } - - //fun TestApplicationRequest.setBodyJson(value: Any?) = setBody(Gson.stringify(value)) -}