Skip to content

Conversation

contrueCT
Copy link

@contrueCT contrueCT commented Sep 13, 2025

Ⅰ. Describe what this PR did

This PR corrects JUnit test method access modifiers and annotation usage:

  • Fix @BeforeEach/@AfterEach method visibility in JUnit 5 tests (private → public)
  • Fix @Rule field access modifier in JUnit 4 tests (private → public)
  • Remove inappropriate @Test annotation from utility methods

These changes ensure proper JUnit framework functionality and test execution.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Copy link
Member

@YongGoose YongGoose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there similar cases elsewhere?
If so, it would be good to address all of them in this PR.

Copy link

codecov bot commented Sep 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.41%. Comparing base (9b97559) to head (ac9973c).

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #7635      +/-   ##
============================================
- Coverage     61.41%   61.41%   -0.01%     
- Complexity      682      684       +2     
============================================
  Files          1324     1324              
  Lines         50047    50047              
  Branches       5910     5910              
============================================
- Hits          30738    30735       -3     
- Misses        16531    16542      +11     
+ Partials       2778     2770       -8     

see 9 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Fix @BeforeEach/@AfterEach methods visibility in JUnit 5 tests
- Fix @rule field access modifier from private to public in JUnit 4 tests
- Remove inappropriate @test annotation from utility method
@contrueCT contrueCT requested a review from YongGoose September 14, 2025 15:56
@contrueCT
Copy link
Author

Are there similar cases elsewhere? If so, it would be good to address all of them in this PR.

Thanks for your suggestion! I’ve checked and fixed all similar cases in the test classes. Could you please take another look when you get a chance?

@contrueCT contrueCT changed the title test: fix JUnit 5 lifecycle method visibility test: fix JUnit test method access modifiers and annotations Sep 14, 2025
@YongGoose
Copy link
Member

Thanks for your suggestion! I’ve checked and fixed all similar cases in the test classes. Could you please take another look when you get a chance?

Please use JUnit5 instead of JUnit4.

@contrueCT
Copy link
Author

Done. Replaced all JUnit4 references with JUnit5. Please take another look when you get a chance.

@contrueCT
Copy link
Author

@YongGoose I've updated the PR based on your feedback. Could you please take another look when you have time? Thanks!

@contrueCT
Copy link
Author

The CI failure in the seata-config-zk module only occurs in the Java 8 build and is unrelated to my changes. The same tests pass successfully in Java 17 and Java 21, indicating a compatibility issue between ZooKeeper client and Java 8 in the CI environment—not a code problem.

@contrueCT
Copy link
Author

Hi @YongGoose ,
I've addressed all the feedback you left in your review https://github.com/apache/incubator-seata/pull/7635#issuecomment-3291173245
Could you please take another look when you have a moment?
Thanks a lot! 😊

@slievrly
Copy link
Member

@YongGoose Pls take a look.

YongGoose

This comment was marked as outdated.

Copy link
Member

@YongGoose YongGoose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please apply spotless :)

Once you’ve fixed the Spotless issues, please ping me and I’ll give my approval.

EtcdListener etcdListener = new EtcdListener();
registryService.subscribe(CLUSTER_NAME, etcdListener);
// 3.delete instance,see if the listener can be notified
registryService.subscribe(DEFAULT_TX_GROUP, etcdListener);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, was there any particular reason for using DEFAULT_TX_GROUP instead of CLUSTER_NAME?

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.

5 participants