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

kturner pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluo.git


The following commit(s) were added to refs/heads/main by this push:
     new 4d964e00 Use asserThrows in place of deprecated Exception.none() 
(#1128)
4d964e00 is described below

commit 4d964e00d6402225fe58674fcfc884e87222cd31
Author: Dom G <[email protected]>
AuthorDate: Sat Dec 3 09:19:11 2022 -0500

    Use asserThrows in place of deprecated Exception.none() (#1128)
---
 .../main/java/org/apache/fluo/integration/impl/FailureIT.java  | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git 
a/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FailureIT.java
 
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FailureIT.java
index cc23f7d2..8c3c6afd 100644
--- 
a/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FailureIT.java
+++ 
b/modules/integration-tests/src/main/java/org/apache/fluo/integration/impl/FailureIT.java
@@ -53,7 +53,6 @@ import org.apache.fluo.integration.TestUtil;
 import org.junit.Assert;
 import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.ExpectedException;
 import org.junit.rules.Timeout;
 
 import static org.apache.fluo.api.observer.Observer.NotificationType.STRONG;
@@ -62,8 +61,6 @@ import static org.apache.fluo.integration.BankUtil.BALANCE;
 public class FailureIT extends ITBaseImpl {
   @Rule
   public Timeout globalTimeout = Timeout.seconds(getTestTimeout());
-  @Rule
-  public ExpectedException exception = ExpectedException.none();
 
   public static class NullObserver implements Observer {
     @Override
@@ -132,8 +129,7 @@ public class FailureIT extends ITBaseImpl {
 
     if (killTransactor) {
       Stamp commitTs = env.getSharedResources().getOracleClient().getStamp();
-      exception.expect(FluoException.class);
-      tx2.commitPrimaryColumn(cd, commitTs);
+      Assert.assertThrows(FluoException.class, () -> 
tx2.commitPrimaryColumn(cd, commitTs));
     } else {
       Stamp commitTs = env.getSharedResources().getOracleClient().getStamp();
       Assert.assertFalse(tx2.commitPrimaryColumn(cd, commitTs));
@@ -322,9 +318,7 @@ public class FailureIT extends ITBaseImpl {
     Stamp commitTs = env.getSharedResources().getOracleClient().getStamp();
 
     if (killTransactor) {
-      // test for exception
-      exception.expect(FluoException.class);
-      tx2.commitPrimaryColumn(cd, commitTs);
+      Assert.assertThrows(FluoException.class, () -> 
tx2.commitPrimaryColumn(cd, commitTs));
     } else {
       Assert.assertFalse(tx2.commitPrimaryColumn(cd, commitTs));
       t1.close();

Reply via email to