withTestApplication sendPipeline interceptors do not work
See original GitHub issueKtor Version and Engine Used (client or server and name) 1.2.6, 1.3.0-rc2
Describe the bug
Any sendPipeline
interceptor installed does not get called when testing using withTestApplication
.
To Reproduce
Steps to reproduce the behavior:
Install a sendPipeline
interceptor an try to use it with a handleRequest
. The interception lambda will not be called.
Expected behavior The interception lambda to be called.
You can check out the test code here in this feature of mine where I’m having the issue. A run of the tests is also available here on TravisCI and the corresponding build scan here.
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (9 by maintainers)
Top Results From Across the Web
Ktor Interceptor Ordering for same Phase and overriding
I see no way to override the merge and delete all but the "last" interceptor for the Phase "Limit". The other "Limit" should...
Read more >HttpRequestPipeline - ktor
All interceptors accept payload as subject and try to convert it to OutgoingContent. Last phase should proceed with HttpClientCall.
Read more >Intro to testing Ktor controllers - Kotlin Testing
Let's suppose that we want to dismiss all calls for api/restricted endpoint if they don't have special header, in this case ...
Read more >Lifecycle - 服务器 - Ktor
You can run a Ktor application in several ways: ... within a web server; As part of a test using withTestApplication from the...
Read more >[Auth] [Interceptors] Phase Phase('Challenge') was not ...
[Auth] [Interceptors] Phase Phase('Challenge') was not registered for this pipeline. Hi! I want to observe and store/retrieve state parameter in Ktor OAuth.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m almost ready to make that decision 😃
Something like this