LuciferYang opened a new pull request #36008:
URL: https://github.com/apache/spark/pull/36008


   ### What changes were proposed in this pull request?
   There are some code patterns in Spark Java UTs:
   
   ```java
   @Test
     public void testAuthReplay() throws Exception {
       try {
         doSomeOperation();
         fail("Should have failed");
       } catch (Exception e) {
         assertTrue(doExceptionCheck(e));
       }
     }
   ```
   or
   ```java
     @Test(expected = SomeException.class)
     public void testAuthReplay() throws Exception {
       try {
         doSomeOperation();
         fail("Should have failed");
       } catch (Exception e) {
         assertTrue(doExceptionCheck(e));
         throw e;
       }
     } 
   ```
   This pr  use Junit `assertThrows` Api to simplify the similar patterns.
   
   
   ### Why are the changes needed?
   Simplify code.
   
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   Pass GA


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to