-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[Junie]: feat: make client property in ApplicationTestBuilder mutable #4879
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
base: main
Are you sure you want to change the base?
[Junie]: feat: make client property in ApplicationTestBuilder mutable #4879
Conversation
A proposal was implemented to allow the `client` property in `ApplicationTestBuilder` to be mutable, enabling better configuration for tests in Ktor. The implementation is error-free, with all existing tests passing along with a new test confirming the functionality of the new configuration capability.
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
@jetbrains-junie, please fix the review comments
@@ -36,7 +36,7 @@ public interface ClientProvider { | |||
* | |||
* @see [testApplication] | |||
*/ | |||
public val client: HttpClient | |||
public var client: HttpClient |
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.
Let's keep val
here, but make it var
in TestApplicationBuilder
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.
@jetbrains-junie fix it
// Create a new client | ||
val configuredClient = createClient { } | ||
|
||
// Set the new client as the default | ||
client = configuredClient |
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.
Let's simplify this
// Create a new client | |
val configuredClient = createClient { } | |
// Set the new client as the default | |
client = configuredClient | |
// Create a new client and set it as the default | |
client = createClient { } |
class ClientConfigurationTest { | ||
|
||
@Test | ||
fun testClientConfiguration() = testApplication { |
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.
We have TestApplicationTest
. Move this test into it
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.
@jetbrains-junie fix it
@jetbrains-junie, after fixing the comments remember to run |
Hey, it’s Junie by JetBrains! I started processing your request 🚀 |
A documentation update was made to the `client` property in the `ClientProvider` interface, explicitly stating that it is mutable and can be configured. The implementation is error-free, the API documentation was successfully updated, and all tests regarding the functionality of the mutable `client` property passed.
class ClientConfigurationTest { | ||
|
||
@Test | ||
fun testClientConfiguration() = testApplication { |
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.
@jetbrains-junie fix it
❌ There is a running Junie process for this pull request. Please, wait until it would be finished or cancel the corresponding Junie action |
…-f8c9-4070-8aeb-afd347a1327d
📌 Hey! This PR was made for you with Junie, the coding agent by JetBrains Early Access Preview
It's still learning, developing, and might make mistakes. Please make sure you review the changes before you accept them.
We’d love your feedback — join our Discord to share bugs, ideas: here.
📊 Junie Summary
A proposal was implemented to allow the
client
property inApplicationTestBuilder
to be mutable, enabling better configuration for tests in Ktor. The implementation is error-free, with all existing tests passing along with a new test confirming the functionality of the new configuration capability.