Skip to content

feat: replace JUnit with TestNG#507

Merged
mserico merged 3 commits intomasterfrom
copilot/replace-junit-with-testng-again
Jan 23, 2026
Merged

feat: replace JUnit with TestNG#507
mserico merged 3 commits intomasterfrom
copilot/replace-junit-with-testng-again

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

fix: #506

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mserico mserico marked this pull request as ready for review January 23, 2026 07:19
@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.05%. Comparing base (aa90a03) to head (65f4d65).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #507      +/-   ##
==========================================
- Coverage   68.08%   68.05%   -0.04%     
==========================================
  Files          63       63              
  Lines        3083     3083              
  Branches      574      574              
==========================================
- Hits         2099     2098       -1     
  Misses        801      801              
- Partials      183      184       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: mserico <140243407+mserico@users.noreply.github.com>
Copilot AI changed the title [WIP] Replace JUnit testing with TestNG Replace JUnit with TestNG Jan 23, 2026
Copilot AI requested a review from mserico January 23, 2026 07:35
@mserico
Copy link

mserico commented Jan 23, 2026

@copilot fix failed CI check: https://github.com/casbin/jcasbin/actions/runs/21278285214/job/61242865399?pr=507

Progress (1): 98/192 kB
Progress (1): 114/192 kB
Progress (1): 131/192 kB
Progress (1): 147/192 kB
Progress (1): 163/192 kB
Progress (1): 180/192 kB
Progress (1): 192 kB    
                    
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/4.0.0/plexus-utils-4.0.0.jar (192 kB at 3.3 MB/s)
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 78 source files with javac [debug target 1.8] to target/classes
[INFO] /home/runner/work/jcasbin/jcasbin/src/main/java/org/casbin/jcasbin/effect/DefaultEffector.java: Some input files use or override a deprecated API.
[INFO] /home/runner/work/jcasbin/jcasbin/src/main/java/org/casbin/jcasbin/effect/DefaultEffector.java: Recompile with -Xlint:deprecation for details.
[INFO] 
[INFO] --- resources:3.3.1:testResources (default-testResources) @ jcasbin ---
[INFO] skip non existing resourceDirectory /home/runner/work/jcasbin/jcasbin/src/test/resources
[INFO] 
[INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ jcasbin ---
[INFO] Recompiling the module because of changed dependency.
[INFO] Compiling 33 source files with javac [debug target 1.8] to target/test-classes
[INFO] -------------------------------------------------------------
Error:  COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
Error:  /home/runner/work/jcasbin/jcasbin/src/test/java/org/casbin/jcasbin/main/AbacAPIUnitTest.java:[18,30] cannot access org.testng.annotations.Test
  bad class file: /home/runner/.m2/repository/org/testng/testng/7.10.2/testng-7.10.2.jar(org/testng/annotations/Test.class)
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.039 s
[INFO] Finished at: 2026-01-23T07:40:05Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:testCompile (default-testCompile) on project jcasbin: Compilation failure
Error:  /home/runner/work/jcasbin/jcasbin/src/test/java/org/casbin/jcasbin/main/AbacAPIUnitTest.java:[18,30] cannot access org.testng.annotations.Test
Error:    bad class file: /home/runner/.m2/repository/org/testng/testng/7.10.2/testng-7.10.2.jar(org/testng/annotations/Test.class)
Error:      class file has wrong version 55.0, should be 52.0
Error:      Please remove or make sure it appears in the correct subdirectory of the classpath.
Error:  
Error:  -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Error: Process completed with exit code 1.

Co-authored-by: mserico <140243407+mserico@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 23, 2026

@copilot fix failed CI check: https://github.com/casbin/jcasbin/actions/runs/21278285214/job/61242865399?pr=507

...

Fixed in commit 65f4d65. The issue was that TestNG 7.10.2 requires Java 11+, but the project uses Java 8. Downgraded to TestNG 7.4.0 (the last version supporting Java 8) and fixed API compatibility issues. All 254 tests now pass.

@mserico mserico changed the title Replace JUnit with TestNG feat: replace JUnit with TestNG Jan 23, 2026
@mserico mserico merged commit 0b3aa15 into master Jan 23, 2026
1 of 3 checks passed
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.

[feature] replace JUnit testing with TestNG

4 participants