|
22 | 22 | import static org.apache.datasketches.thetacommon.BinomialBoundsN.checkArgs; |
23 | 23 | import static org.apache.datasketches.thetacommon.BinomialBoundsN.getLowerBound; |
24 | 24 | import static org.apache.datasketches.thetacommon.BinomialBoundsN.getUpperBound; |
25 | | -import static org.testng.Assert.assertEquals; |
26 | | -import static org.testng.Assert.assertTrue; |
27 | | -import static org.testng.Assert.fail; |
| 25 | +import static org.testng.Assert.*; |
28 | 26 |
|
29 | 27 | import org.apache.datasketches.common.SketchesArgumentException; |
30 | 28 | import org.apache.datasketches.thetacommon.BinomialBoundsN; |
@@ -119,17 +117,17 @@ public static void checkBounds() { |
119 | 117 |
|
120 | 118 | @Test |
121 | 119 | public static void checkCheckArgs() { |
122 | | - try { |
123 | | - checkArgs(-1L, 1.0, 1); |
124 | | - checkArgs(10L, 0.0, 1); |
125 | | - checkArgs(10L, 1.01, 1); |
126 | | - checkArgs(10L, 1.0, 3); |
127 | | - checkArgs(10L, 1.0, 0); |
128 | | - checkArgs(10L, 1.0, 4); |
129 | | - fail("Expected SketchesArgumentException"); |
130 | | - } catch (final SketchesArgumentException e) { |
131 | | - //pass |
132 | | - } |
| 120 | + assertThrows(SketchesArgumentException.class, |
| 121 | + () -> checkArgs(-1L, 1.0, 1)); |
| 122 | + assertThrows(SketchesArgumentException.class, |
| 123 | + () -> checkArgs(10L, 0.0, 1)); |
| 124 | + assertThrows(SketchesArgumentException.class, |
| 125 | + () -> checkArgs(10L, 1.01, 1)); |
| 126 | + checkArgs(10L, 1.0, 3); |
| 127 | + assertThrows(SketchesArgumentException.class, |
| 128 | + () -> checkArgs(10L, 1.0, 0)); |
| 129 | + assertThrows(SketchesArgumentException.class, |
| 130 | + () -> checkArgs(10L, 1.0, 4)); |
133 | 131 | } |
134 | 132 |
|
135 | 133 | @Test |
|
0 commit comments