This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push: new 7dc5436 Fix #2042 Replace assertTrue with assertArrayEquals in KeyTest (#2079) 7dc5436 is described below commit 7dc54362fca1369f18c2057b57302886360beee1 Author: EdColeman <d...@etcoleman.com> AuthorDate: Wed May 5 15:40:39 2021 -0400 Fix #2042 Replace assertTrue with assertArrayEquals in KeyTest (#2079) * Changed KeyTest for assertArrayEquals assertion * Fixed the import error * Fixed the assert import error * auto-format corrections Co-authored-by: vallari118 <navivall...@gmail.com> Co-authored-by: Ed Coleman etcoleman <edcole...@apache.org> --- .../java/org/apache/accumulo/core/data/KeyTest.java | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java b/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java index ccb7789..fbc0eb0 100644 --- a/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java +++ b/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java @@ -18,13 +18,13 @@ */ package org.apache.accumulo.core.data; +import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import java.util.ArrayList; -import java.util.Arrays; import java.util.Iterator; import java.util.List; @@ -117,25 +117,25 @@ public class KeyTest { if (key.getRowBytes().length != 0) { assertNotSame(row, key.getRowBytes()); assertNotSame(row, key.getRowData().getBackingArray()); - assertTrue(Arrays.equals(row, key.getRowBytes())); + assertArrayEquals(row, key.getRowBytes()); } if (key.getColFamily().length != 0) { assertNotSame(cf, key.getColFamily()); assertNotSame(cf, key.getColumnFamilyData().getBackingArray()); - assertTrue(Arrays.equals(cf, key.getColFamily())); + assertArrayEquals(cf, key.getColFamily()); } if (key.getColQualifier().length != 0) { assertNotSame(cq, key.getColQualifier()); assertNotSame(cq, key.getColumnQualifierData().getBackingArray()); - assertTrue(Arrays.equals(cq, key.getColQualifier())); + assertArrayEquals(cq, key.getColQualifier()); } if (key.getColVisibility().length != 0) { assertNotSame(cv, key.getColVisibility()); assertNotSame(cv, key.getColumnVisibilityData().getBackingArray()); - assertTrue(Arrays.equals(cv, key.getColVisibility())); + assertArrayEquals(cv, key.getColVisibility()); } } @@ -178,19 +178,16 @@ public class KeyTest { // are converted to byte array containing // the same value if (key.getRowBytes().length != 0) { - assertTrue(Arrays.equals(row, key.getRowBytes())); - + assertArrayEquals(row, key.getRowBytes()); } if (key.getColFamily().length != 0) { - assertTrue(Arrays.equals(cf, key.getColFamily())); - + assertArrayEquals(cf, key.getColFamily()); } if (key.getColQualifier().length != 0) { - assertTrue(Arrays.equals(cq, key.getColQualifier())); - + assertArrayEquals(cq, key.getColQualifier()); } if (key.getColVisibility().length != 0) { - assertTrue(Arrays.equals(cv, key.getColVisibility())); + assertArrayEquals(cv, key.getColVisibility()); } }