I'm trying to run some new parameterized Android tests with null in the parameter set. Unfortunately, the values are showing up as the string "null" instead of null
. How can I keep this from happening?
@RunWith(Parameterized.class)
public class PedigreeProviderTest {
@Parameter()
@SuppressWarnings("WeakerAccess")
public String mVin;
@Parameter(value = 1)
@SuppressWarnings("WeakerAccess")
public String mDap;
@Parameter(value = 2)
@SuppressWarnings("WeakerAccess")
public int mAddress;
@Parameter(value = 3)
@SuppressWarnings("WeakerAccess")
public int mBusId;
@Parameters
public static Collection<Object[]> parameters() {
return Arrays.asList(new Object[][]{
{null, null, 0x7F, 0},
{"1FUYFXYB3XPA96364", null, 0x7F, 0},
{"1HD4CAM30YK190948", "00D06948C67C", 0x7F, 0},
{null, "00D06948C67C", 0x7F, 0},
});
}
@Test
public void testSomething(){
"null".equals(mVin); //is true for parameter 0 and 3
mVin == null; //is never the case
}
...
}