This is an automated email from the ASF dual-hosted git repository.

peter-toth pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.5 by this push:
     new c59b763948a9 [SPARK-57889][3.5][CORE][TEST][FOLLOWUP] Use JUnit 4 
Assert.assertThrows in OneForOneStreamManagerSuite
c59b763948a9 is described below

commit c59b763948a98825ddd04fdcc69cf2802caa53cc
Author: Peter Toth <[email protected]>
AuthorDate: Fri Jul 3 18:10:04 2026 +0200

    [SPARK-57889][3.5][CORE][TEST][FOLLOWUP] Use JUnit 4 Assert.assertThrows in 
OneForOneStreamManagerSuite
    
    ### What changes were proposed in this pull request?
    This is a follow-up build fix of https://github.com/apache/spark/pull/56970 
(SPARK-57889) for `branch-3.5`.
    
    The cherry-pick of SPARK-57889 to `branch-3.5` fails to compile because the 
new `OneForOneStreamManagerSuite.testStreamRequestAuthorization` test uses 
`Assertions.assertThrows` (JUnit 5). On `master` this suite has already been 
migrated to JUnit 5, but on `branch-3.5` it still uses JUnit 4 
(`org.junit.Assert` / `org.junit.Test`), so `Assertions` does not resolve.
    
    This changes the single call to JUnit 4's `Assert.assertThrows` (available 
since JUnit 4.13), consistent with the rest of the file on `branch-3.5`. No 
production code changes.
    
    ### Why are the changes needed?
    Without this fix, `common/network-common` test compilation fails on 
`branch-3.5`, breaking the build after the SPARK-57889 cherry-pick.
    
    ### Does this PR introduce _any_ user-facing change?
    No. Test-only change.
    
    ### How was this patch tested?
    `build/mvn -pl common/network-common surefire:test 
-Dtest=OneForOneStreamManagerSuite` now compiles and passes (5 tests run, 0 
failures), including `testStreamRequestAuthorization`.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    Generated-by: Claude Code (Opus 4.8)
    
    Closes #56988 from peter-toth/SPARK-57889-follow-up-3.5.
    
    Lead-authored-by: Peter Toth <[email protected]>
    Co-authored-by: Peter Toth <[email protected]>
    Signed-off-by: Peter Toth <[email protected]>
---
 .../org/apache/spark/network/server/OneForOneStreamManagerSuite.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/common/network-common/src/test/java/org/apache/spark/network/server/OneForOneStreamManagerSuite.java
 
b/common/network-common/src/test/java/org/apache/spark/network/server/OneForOneStreamManagerSuite.java
index 1d0d37dd6e44..be7f32c59dca 100644
--- 
a/common/network-common/src/test/java/org/apache/spark/network/server/OneForOneStreamManagerSuite.java
+++ 
b/common/network-common/src/test/java/org/apache/spark/network/server/OneForOneStreamManagerSuite.java
@@ -176,7 +176,7 @@ public class OneForOneStreamManagerSuite {
     // ChunkFetchRequest path.
     TransportClient otherApp = Mockito.mock(TransportClient.class);
     Mockito.when(otherApp.getClientId()).thenReturn("app2");
-    Assertions.assertThrows(SecurityException.class,
+    Assert.assertThrows(SecurityException.class,
       () -> manager.checkAuthorization(otherApp, streamChunkId));
 
     // The owning application is allowed.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to