Call with in more tests#2119
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors several Kotlin test cases to use with(...) blocks (and expression-bodied test functions) to reduce repeated transformer. qualifiers and improve consistency across transformer-related tests.
Changes:
- Converted multiple
@Test/@ParameterizedTestmethods to expression bodies returningwith(transformer) { ... }. - Updated test bodies to call transformer members directly within the
withreceiver. - Applied the same pattern to a few tests that instantiate transformers inline (e.g.,
with(ServiceFileTransformer()) { ... }).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/XmlAppendingTransformerTest.kt | Refactor to with(transformer) for concise resource setup and assertions. |
| src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ServiceFileTransformerTest.kt | Refactor multiple tests/parameterized tests to use with(...) receivers for transformer calls. |
| src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformerTest.kt | Refactor parameterized tests and assertions to use with(transformer) and receiver-qualified properties. |
| src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ManifestAppenderTransformerTest.kt | Refactor to with(transformer) for append/transform assertions and the “noTransformation” case. |
| src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/Log4j2PluginsCacheFileTransformerTest.kt | Refactor tests to use with(transformer) while keeping transformation and jar inspection logic intact. |
| src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ComponentsXmlResourceTransformerTest.kt | Refactor to with(transformer) for transform calls and XML comparison. |
| src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/AppendingTransformerTest.kt | Refactor to with(transformer) for resource setup and can-transform assertions. |
| src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ApacheNoticeResourceTransformerTest.kt | Refactor to with(transformer) for include/exclude and output validation. |
| src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ApacheLicenseResourceTransformerTest.kt | Refactor to with(transformer) for include/exclude and can-transform assertions. |
| src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/MinimizeSpecsTest.kt | Refactor to with(...) for concise spec creation and assertions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.