Squashed deprecation warnings in test code.
This commit is contained in:
parent
795fe5d869
commit
5556118ad1
|
@ -238,7 +238,7 @@ public class ArrayUtilsAddTest {
|
|||
//expected
|
||||
}
|
||||
try {
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({ "unused", "deprecation" })
|
||||
final
|
||||
String[] sa = ArrayUtils.add(stringArray, 0, aString);
|
||||
fail("Should have caused IllegalArgumentException");
|
||||
|
@ -365,6 +365,7 @@ public class ArrayUtilsAddTest {
|
|||
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Test
|
||||
public void testAddObjectAtIndex() {
|
||||
Object[] newArray;
|
||||
|
|
|
@ -42,6 +42,18 @@ import org.junit.Test;
|
|||
@SuppressWarnings("deprecation") // deliberate use of deprecated code
|
||||
public class ArrayUtilsTest {
|
||||
|
||||
|
||||
static <T> T[] arrayOfTwo(T a, T b) {
|
||||
return ArrayUtils.toArray(a, b);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBadVarArgs() throws Exception {
|
||||
@SuppressWarnings("unused") // Need to assign to trigger exception
|
||||
String[] result = arrayOfTwo("foo", "bar");
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@Test
|
||||
public void testConstructor() {
|
||||
|
|
Loading…
Reference in New Issue