Skip to content

Conversation

@marevol
Copy link
Contributor

@marevol marevol commented Jan 14, 2026

Summary

  • Refactored the test framework by updating UnitFessTestCase.tearDown() to properly accept TestInfo parameter
  • Cleaned up redundant JUnit 5 lifecycle annotations across 190+ test classes
  • Improved code readability in LLM client classes with better formatting

Changes Made

Test Framework Updates

  • Updated UnitFessTestCase.tearDown() method signature to accept TestInfo parameter, aligning with JUnit 5 best practices
  • Modified all test classes extending UnitFessTestCase to pass TestInfo to the tearDown() method
  • Removed redundant @BeforeEach annotations from test classes where the parent class already handles the setup lifecycle
  • Removed redundant @AfterEach annotations from test classes where the parent class already handles the teardown lifecycle

Code Formatting Improvements

  • Reformatted GeminiLlmClient.java with improved builder pattern line breaks for better readability
  • Reformatted OpenAiLlmClient.java with improved builder pattern line breaks for better readability
  • Applied consistent formatting style to OkHttpClient and Request builder chains

Testing

  • The changes are primarily cleanup and formatting improvements
  • All existing tests should continue to pass as the behavior remains unchanged

Additional Notes

  • This PR reduces code duplication by removing ~564 lines of redundant annotation code
  • No functional changes to the test behavior or LLM client functionality

- Update UnitFessTestCase.tearDown() to accept TestInfo parameter for
  JUnit 5 compatibility
- Remove redundant @beforeeach and @AfterEach annotations from test
  classes that already inherit proper lifecycle from UnitFessTestCase
- Improve code formatting in LLM client classes (GeminiLlmClient,
  OpenAiLlmClient) with better builder pattern line breaks for
  readability
@marevol marevol self-assigned this Jan 14, 2026
@marevol marevol requested a review from Copilot January 14, 2026 14:23
@marevol marevol added the task label Jan 14, 2026
@marevol marevol added this to the 15.5.0 milestone Jan 14, 2026
Copy link
Contributor

Copilot AI left a 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 PR refactors the test framework to align with JUnit 5 best practices by updating the UnitFessTestCase.tearDown() method signature to accept a TestInfo parameter. It removes redundant @BeforeEach and @AfterEach annotations from test classes that extend UnitFessTestCase, as the parent class already handles the test lifecycle. Additionally, it improves code readability in LLM client classes by reformatting builder pattern method chains.

Changes:

  • Updated UnitFessTestCase.tearDown() to accept TestInfo parameter
  • Removed redundant JUnit 5 lifecycle annotations (@BeforeEach, @AfterEach) from 190+ test classes
  • Reformatted builder patterns in OpenAiLlmClient.java and GeminiLlmClient.java for better readability

Reviewed changes

Copilot reviewed 192 out of 192 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/test/java/org/codelibs/fess/unit/UnitFessTestCase.java Updated tearDown() method signature to accept TestInfo parameter
src/test/java/org/codelibs/fess/validation/*.java Removed redundant @BeforeEach annotations from validation test classes
src/test/java/org/codelibs/fess/util/*.java Removed redundant lifecycle annotations and updated tearDown() calls
src/test/java/org/codelibs/fess/llm/**/*.java Removed redundant lifecycle annotations and updated tearDown() calls
src/main/java/org/codelibs/fess/llm/openai/OpenAiLlmClient.java Reformatted builder pattern chains for improved readability
src/main/java/org/codelibs/fess/llm/gemini/GeminiLlmClient.java Reformatted builder pattern chains for improved readability

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

@marevol marevol merged commit 43aa04b into master Jan 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants