-
Notifications
You must be signed in to change notification settings - Fork 325
[G2J] call site instrumentation plugin #10462
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: master
Are you sure you want to change the base?
Changes from all commits
44aeab8
7f9c2d3
d32ba4d
f97d8fc
68ecb35
c7521ee
4747f93
f613ec8
d85492f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| name: migrate-groovy-to-java | ||
| description: migrate test groovy files to java | ||
| --- | ||
|
|
||
| Migrate test Groovy files to Java using JUnit 5 | ||
|
|
||
| 1. List all groovy files of the current gradle module | ||
| 2. convert groovy files to Java using Junit 5 | ||
| 3. make sure the tests are still passing after migration | ||
| 4. remove groovy files | ||
|
|
||
| When converting groovy code to java code make sure that: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New point: |
||
| - the Java code generated is compatible with JDK 8 | ||
| - when translating Spock test, favor using `@CsvSource` with `|` delimiters | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: New point:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't be
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes possibly, both are fine by me, but let's keep it closer to JUnit for this one. |
||
| - when using a `@MethodSource`, use the test method name, and suffix it with `_arguments` | ||
| - when converting tuples, create light dedicated structure instead to keep the typing system | ||
| - Instead of checking a state and throwing an exception, use JUnit asserts | ||
| - Do not wrap checked exception and throwing a Runtime exception, prefer adding a throws clause at method declaration | ||
| - Do not mark local variables `final` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: What about using AssertJ's richer assertion API rather than using JUnit ones. This would avoid unnecessary type conversions and would ease reading the code. |
||
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.
🎯 suggestion:
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.
Cool! Did you get a better code with this skill? Can we have some instructions how to use 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.
just type
/migrate-groovy-to-javain claude code promptThere 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.
Regarding suggestion: Prefer to keep refactoring separate from migration
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.
The suggestion was more to make sure the generated code stays closer to what we have already. It sometimes use and abuse of patterns it copies/pastes everywhere.
But without way to evaluate prompt, it's tough to find out if it will be effective or not - if it applies it without refactoring the code logic.