so i need to determine if an Integer[] expResult is equal to an Integer[] result, i tried to use assertTrue and assertEquals but they will not work.. if someone could help me it would be very nice! thanks
Asked
Active
Viewed 95 times
-1
-
2Have you tried [java.util.Arrays.equals()](http://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html#equals-java.lang.Object:A-java.lang.Object:A-)? – President James K. Polk Nov 14 '15 at 22:05
2 Answers
2
You can use assertArrayEquals like:
Assert.assertArrayEquals(new int[]{1,2,3},new int[]{1,2,3});

Adam Williams
- 1,712
- 3
- 17
- 30

Ebbe M. Pedersen
- 7,250
- 3
- 27
- 47
0
You can do it as
Assert.assertEquals(Arrays.asList(a), Arrays.asList(b));

Francisco Hernandez
- 2,378
- 14
- 18