GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JUnit Jupiter best practices by slachiewicz · Pull Request #91 · codehaus-plexus/plexus-interpolation

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Nov 2, 2025

Copy link
Copy Markdown
Member

Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.java.testing.junit.JupiterBestPractices?organizationId=NzQ1YmJlODUtZjNkMy00OTNkLThhNDAtZWJmZDg4N2U1ZjU1

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@slachiewicz
slachiewicz marked this pull request as ready for review November 3, 2025 16:09
@slachiewicz slachiewicz added the maintenance Cleanup, refactoring or other internal change label Nov 3, 2025
@slachiewicz @TeamModerne
JUnit Jupiter best practices & tests cleanup
4ec3931
Co-authored-by: Moderne <[email protected]>
@slachiewicz
slachiewicz requested a review from Copilot November 3, 2025 16:33
Copilot AI reviewed Nov 3, 2025
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown

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.

Pull Request Overview

This pull request modernizes JUnit test code across multiple test classes by adopting Java 8+ language features and JUnit 5 conventions. The changes improve code readability and maintainability while standardizing test naming patterns.

  • Updated test class and method visibility from public to package-private (removing public modifier)
  • Renamed test methods to remove "test" prefix following JUnit 5 naming conventions
  • Simplified exception declarations from specific exceptions to generic Exception
  • Modernized Java syntax using diamond operators for generic type inference
  • Converted anonymous classes to lambda expressions where applicable
  • Removed unnecessary wrapper calls (e.g., Collections.unmodifiableList(Collections.singletonList(...)) to Collections.singletonList(...))
  • Cleaned up unused imports
  • Made fields final where appropriate

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
StringUtilsTest.java Updated class/method visibility and naming
FieldBasedObjectInterpolatorTest.java Modernized syntax with diamond operators, removed redundant Collections wrapper, updated visibility/naming
MultiDelimiterStringSearchInterpolatorTest.java Simplified exceptions, added diamond operators, lambda conversions, removed unused imports, updated naming
MultiDelimiterInterpolatorFilterReaderTest.java Comprehensive modernization including lambdas, diamond operators, updated visibility/naming
FixedStringSearchInterpolatorTest.java Lambda conversions, diamond operators, simplified exceptions, made field final, updated naming
EnvarBasedValueSourceTest.java Lambda conversions, diamond operators, removed license header, updated naming
StringSearchInterpolatorTest.java Extensive modernization including lambdas, diamond operators, made field final, removed license header
RegexBasedInterpolatorTest.java Lambda conversions, diamond operators, removed license header, updated naming
PropertiesBasedValueSourceTest.java Updated visibility and naming
PrefixedValueSourceWrapperTest.java Updated visibility and naming
PrefixedObjectValueSourceTest.java Updated visibility, naming, and diamond operators
PrefixAwareRecursionInterceptorTest.java Updated visibility, naming, and removed unnecessary array wrapper
InterpolatorFilterReaderTest.java Updated visibility, naming, and diamond operators
FeedbackingValueSourceTest.java Updated visibility, naming, and simplified exceptions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/org/codehaus/plexus/interpolation/RegexBasedInterpolatorTest.java
RegexBasedInterpolator rbi = new RegexBasedInterpolator();

Map context = new HashMap();
Map<String, String> context = new HashMap();

Copilot AI Nov 3, 2025

Copy link

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.

Missing diamond operator '<>' for HashMap instantiation. Should be 'new HashMap<>()' to be consistent with other modernizations in this PR.

Suggested change
Map<String, String> context = new HashMap();
Map<String, String> context = new HashMap<>();

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot uses AI. Check for mistakes.
@slachiewicz
slachiewicz merged commit 80e5f3c into codehaus-plexus:master Nov 3, 2025
@slachiewicz
slachiewicz deleted the feature/j-unit-jupiter-best-practices branch November 3, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

maintenance Cleanup, refactoring or other internal change

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@slachiewicz
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.