-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Ktor to 3.0.3 #2066
base: master
Are you sure you want to change the base?
Update Ktor to 3.0.3 #2066
Conversation
… Type for invalid POST payload
every { application } returns mockk(relaxed = true) { | ||
every { receivePipeline } returns ApplicationReceivePipeline() | ||
} | ||
coEvery { receiveNullable<Any>(any()) } answers { callOriginal() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
receiveNullable()
(which is called from ApplicationCall.receive()
in KtorGraphQLRequestParser.parsePostRequest()
) is now an instance method instead of an extension function which is why ApplicationCall.receive()
returns null when using a mock.
Using callOriginal()
calls the instance method instead.
@@ -31,11 +31,11 @@ class CustomScalarKotlinxTests { | |||
|
|||
@Test | |||
fun `verify custom scalars are correctly serialized and deserialized`() { | |||
val engine = embeddedServer(CIO, port = 0, module = Application::graphQLModule) | |||
val embeddedServer = embeddedServer(CIO, port = 0, module = Application::graphQLModule) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
embeddedServer()
now returns an EmbeddedServer
which contains the ApplicationEngine
.
https://ktor.io/docs/migrating-3.html#EmbeddedServer
|
||
fun Application.graphQLModule() { | ||
install(WebSockets) { | ||
pingPeriod = Duration.ofSeconds(1) | ||
pingPeriod = 1.seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Websockets plugin now uses kotlin.time
.
https://youtrack.jetbrains.com/issue/KTOR-7446
|
||
private fun testModule(block: suspend io.ktor.server.testing.ApplicationTestBuilder.() -> kotlin.Unit) = testApplication { | ||
environment { | ||
config = ApplicationConfig(("application.conf")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modules need to be explicitly loaded.
https://ktor.io/docs/migrating-3.html#test-module-loading
📝 Description
Updated Ktor and updated failing tests and fixed compile issues resulting from the update.
Also updated some libraries.
🔗 Related Issues
#2037