Skip to content

Commit

Permalink
javac: include fail to enforce exception expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ray Mattingly committed Apr 21, 2023
1 parent ca23322 commit e87b3ed
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.hadoop.hbase.quotas;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.testclassification.SmallTests;
Expand All @@ -36,6 +37,7 @@ public class TestRpcThrottlingException {
public void itHandlesSecWaitIntervalMessage() {
try {
RpcThrottlingException.throwNumReadRequestsExceeded(1001);
fail();
} catch (RpcThrottlingException e) {
assertTrue(e.getMessage().contains("wait 1sec, 1ms"));
}
Expand All @@ -45,6 +47,7 @@ public void itHandlesSecWaitIntervalMessage() {
public void itHandlesMsWaitIntervalMessage() {
try {
RpcThrottlingException.throwNumReadRequestsExceeded(50);
fail();
} catch (RpcThrottlingException e) {
assertTrue(e.getMessage().contains("wait 50ms"));
}
Expand All @@ -54,6 +57,7 @@ public void itHandlesMsWaitIntervalMessage() {
public void itHandlesMinWaitIntervalMessage() {
try {
RpcThrottlingException.throwNumReadRequestsExceeded(65_015);
fail();
} catch (RpcThrottlingException e) {
assertTrue(e.getMessage().contains("wait 1mins, 5sec, 15ms"));
}
Expand Down

0 comments on commit e87b3ed

Please sign in to comment.