Skip to content

Conversation

timtebeek
Copy link
Member

@timtebeek timtebeek commented Jul 30, 2025

@timtebeek timtebeek self-assigned this Jul 30, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Jul 30, 2025
@timtebeek timtebeek added recipe Recipe request assertj labels Jul 30, 2025
timtebeek and others added 9 commits August 6, 2025 23:00
Applied automated reordering of recipe examples from rewriteRun task.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added tests for various scenarios that should NOT be converted:
- Nested try-catch blocks (documented current behavior)
- Catch blocks with return statements
- Exception re-throwing
- Exception logging
- Exception variable assignment
- Try-with-resources
- Custom assertions (assertTrue, assertNotNull)
- Complex exception handling logic

Also added tests for:
- Handling of wildcard AssertJ imports
- Nested class exceptions (expects fully qualified name)
- Comment retention behavior

These tests ensure the recipe's conservative approach is maintained
and document current behavior for future enhancements.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Applied best practices recipe which reordered the TestMethodsShouldBeVoid example entry in the YAML file for better organization.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@timtebeek timtebeek marked this pull request as ready for review August 19, 2025 22:01
@timtebeek timtebeek merged commit 31da639 into main Aug 19, 2025
2 checks passed
@timtebeek timtebeek deleted the convert-try-fail-catch-to-assertThatThrownBy branch August 19, 2025 22:20
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assertj recipe Recipe request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Convert try/catch blocks with fail() to assertThatThrownBy
1 participant