Elio Maroun
12/06/2022, 12:42 PMElio Maroun
12/06/2022, 12:43 PMAbdulaziz Mohammed
12/06/2022, 7:42 PMDani Morillas
12/07/2022, 8:43 AM@Test
fun `when user user exists returns code 490`() : Unit = testApplication {
val client = createClient {
install(ContentNegotiation) {
json()
}
}
RepositoriesProvider.userRepository.add(User("", "username", "", false, 0, 0))
val response = <http://client.post|client.post>("/signup") {
contentType(ContentType.Application.Json)
setBody(UserRequest("username", "password"))
}
assertThat(response.status).isEqualTo(HttpStatusCode.Conflict)
}
to test the end point. I define the testApplication and the client to install the ContentNegotiation. But I have two questions here:
1. Do I need to repeat the createClient code in every method? Is there any way I can wrap the testApplication with this initialization and use it in all the tests.
2. The instance of the userRepository object is different in this test than in the code when the endpoint is reached. Am I missing something in the initialization so I can use the same instance?
Thanks in advance!Martin Gaens
12/07/2022, 10:44 AMbuild
Gradle task.
4. Watch the folder build/libs/
. The .jar
files get generated. Watch their size.
5. Go back to step 3.
Doing this a couple of times causes the .jars to be exponentially large for some reason. I don't know why!Beowulf
12/07/2022, 2:25 PMoverride fun deserialize(decoder: Decoder): MyEnum {
return if (decoder.decodeNotNullMark()) {
val enumValue = decoder.decodeInt()
MyEnum.values().firstOrNull {
it.id == enumValue
} ?: MyEnum.DEFAULT
} else {
MyEnum.DEFAULT
}
}
org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during file facade code generation
Anybody an idea how I can fix this?Paul Woitaschek
12/07/2022, 5:25 PMAlexander Weickmann
12/07/2022, 7:44 PMjava.lang.ClassNotFoundException: kotlinx.atomicfu.AtomicFU
Nicolas Verinaud
12/08/2022, 7:51 AMBino
12/08/2022, 9:01 AMrouting {
authenticate("auth-basic") {
this@routing.swaggerUI(path = "/swagger", swaggerFile = "openapi/documentation.yaml") {
version = "4.15.5"
}
}
}
FunkyMuse
12/08/2022, 7:14 PMhiperbou
12/09/2022, 12:43 PMAdel Ayman
12/09/2022, 4:50 PMSlackbot
12/10/2022, 4:59 PMRodrigo Silva
12/10/2022, 6:11 PMDamien O'Hara
12/11/2022, 1:46 PMAlexandre Conte
12/12/2022, 9:13 AMdave08
12/12/2022, 12:23 PMdave08
12/12/2022, 12:23 PMAndré Martins
12/13/2022, 10:19 AMdave08
12/13/2022, 1:08 PMAndrey Tabakov
12/13/2022, 1:35 PMJoshua Hansen
12/13/2022, 4:59 PMSean Proctor
12/14/2022, 3:11 AMJens Suhr
12/14/2022, 10:49 AMHostRouteSelector::evaluate
function uses context.call.request.origin.serverPort
to determine if a request matches the port
routing filter. I’m not sure why it doesn’t call localPort
instead, as that’s (as far as I understand) the port where the request is actually received.
We use a ktor application with CIO in k8s behind mapped ports and an ingress, so the port in the Host
headers is something completely different from what we specify in our routing. Before 2.2, it worked - probably by accident - because CIO used the local information first.
Is there a way to make this work with 2.2? Doesn’t seem like an unusual use case, but I’m probably missing something simple here.Berkay Özkan
12/15/2022, 9:26 AMleandro
12/15/2022, 3:43 PMHttpClientEngineBase
intended to be subclassed? I ask because suspend fun execute(data: HttpRequestData): HttpResponseData
is maked as @InternalAPI
, but HttpClientEngineBase
itself isn’t.Aminu Babayo Shehu
12/16/2022, 2:33 PMAdam Cooper
12/16/2022, 8:48 PMAdam Cooper
12/16/2022, 8:48 PM