Skip to content

Conversation

@drow931
Copy link

@drow931 drow931 commented Jan 21, 2026

What type of PR is this?

  • Bug fix
  • New feature
  • Code refactoring
  • Test improvement
  • Documentation update
  • CI/CD improvement

What this PR does / why we need it

This PR migrates unit tests from JUnit 4 to JUnit 5 (Jupiter) across three modules to ensure compatibility with Spring Boot 3.x and align with modern testing practices.

Which modules are affected

  • trpc-code-generator
  • trpc-configcenter/trpc-configcenter-nacos
  • trpc-configcenter/trpc-configcenter-open-polaris
  • trpc-limiter/trpc-limiter-sentinel

Changes

API Migration

JUnit 4 JUnit 5
org.junit.Assert org.junit.jupiter.api.Assertions
org.junit.Test org.junit.jupiter.api.Test
org.junit.BeforeClass org.junit.jupiter.api.BeforeAll
Assert.assertEquals() Assertions.assertEquals()
Assert.assertTrue() Assertions.assertTrue()
Assert.assertFalse() Assertions.assertFalse()
Assert.assertNotNull() Assertions.assertNotNull()

Files Changed (25 files)

  • trpc-code-generator: 6 test files migrated
  • trpc-configcenter-nacos: 1 test file migrated + pom.xml updated
  • trpc-configcenter-open-polaris: 2 test files migrated + pom.xml updated
  • trpc-limiter-sentinel: 14 test files migrated + pom.xml updated

Special notes for your reviewer

  1. No functional changes - this is a pure test framework migration
  2. All existing test logic and assertions remain unchanged
  3. JUnit 5 dependencies have been added to the relevant pom.xml files where needed
  4. This change is part of the ongoing effort to modernize the test infrastructure for Spring Boot 3.x compatibility

Does this PR introduce a breaking change?

  • No

How Has This Been Tested?

  • All migrated unit tests pass successfully
  • Verified no regression in test coverage

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project
  • I have added/updated tests to cover my changes
  • All new and existing tests passed

@drow931 drow931 closed this Jan 21, 2026
@drow931 drow931 reopened this Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant