revert to old build script
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Torma Kristóf 2020-05-20 15:37:21 +02:00
parent f2cb3e4e91
commit 15095f2d9f
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
4 changed files with 4 additions and 126 deletions

View File

@ -1,7 +1,7 @@
FROM openjdk:11-jre FROM openjdk:11-jre
ENV APPLICATION_USER ktor ENV APPLICATION_USER ktor
RUN adduser -D -g '' $APPLICATION_USER RUN adduser --defaults --gid '' $APPLICATION_USER
RUN mkdir /app RUN mkdir /app
RUN chown -R $APPLICATION_USER /app RUN chown -R $APPLICATION_USER /app

View File

@ -67,4 +67,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
} }
shadowJar { shadowJar {
baseName = 'output-service-rdb'
classifier = null
version = null
} }

View File

@ -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)
}
}
}
}

View File

@ -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 <R> 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))
}