You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/10/21 07:16:32 UTC

[GitHub] [commons-math] nhojpatrick commented on a diff in pull request #216: JUnit5 assertThrows NeuronSquareMesh2DTest

nhojpatrick commented on code in PR #216:
URL: https://github.com/apache/commons-math/pull/216#discussion_r1001448036


##########
commons-math-neuralnet/src/test/java/org/apache/commons/math4/neuralnet/twod/NeuronSquareMesh2DTest.java:
##########
@@ -36,32 +36,37 @@
 import org.apache.commons.math4.neuralnet.Neuron;
 import org.apache.commons.math4.neuralnet.SquareNeighbourhood;
 
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
 /**
  * Tests for {@link NeuronSquareMesh2D} and {@link Network} functionality for
  * a two-dimensional network.
  */
 public class NeuronSquareMesh2DTest {
+
     private final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
     private final FeatureInitializer init = FeatureInitializerFactory.uniform(rng, 0, 2);
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testMinimalNetworkSize1() {
         final FeatureInitializer[] initArray = {init};
 
-        new NeuronSquareMesh2D(1, false,
-                               2, false,
-                               SquareNeighbourhood.VON_NEUMANN,
-                               initArray);
+        assertThrows(IllegalArgumentException.class, () ->
+                new NeuronSquareMesh2D(1, false,

Review Comment:
   done alignment, i'm just using IntelliJ auto formatting, if your aware of a Apache Commons Code Style file for IntelliJ it would make life easier in future.



-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org