aherbert commented on code in PR #214:
URL: https://github.com/apache/commons-math/pull/214#discussion_r1001086243
##########
commons-math-transform/src/test/java/org/apache/commons/math4/transform/TransformUtilsTest.java:
##########
@@ -22,27 +22,34 @@
import org.junit.Test;
import org.apache.commons.math3.analysis.function.Sin;
+import org.junit.jupiter.api.function.Executable;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
/**
* Tests for {@link TransformUtils}.
*/
public class TransformUtilsTest {
+
private static final Sin SIN_FUNCTION = new Sin();
private static final DoubleUnaryOperator SIN = x -> SIN_FUNCTION.value(x);
- @Test(expected = TransformException.class)
+ @Test
public void testSampleWrongBounds() {
- TransformUtils.sample(SIN, Math.PI, 0.0, 10);
+ final Executable testMethod = () -> TransformUtils.sample(SIN,
Math.PI, 0.0, 10);
Review Comment:
I would remove the import of `Executable` and just use the lambda function
direct within assertThrows.
--
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]