Hi I have a method that accepts a List<String> param as a parameter. I'm writing a JUnit test which needs to be able to accept the parameters as a String and then it needs converted to a List<String>
The JUnit code is:
public void testMethodName(String params, String expectedResult){
final String testCollection = instance.MethodName(params);
if (null == expectedResult){
assertNull("Should return null for unspecified value", testCollection);
}
else{
assertEquals("Should return expected value", expectedResult, testCollection);
}
}
public Object[] parametersForTestMappingCollection(){
final List<Object> testCases = new ArrayList<Object>();
testCases.add(JUnitParamsRunner.$("Company Request-Other than Non Payment", "UR"));
Its basically to test a hashmap to make sure the key returns the correct value. So I basically wanted to know how I can convert each of the strings to a List<String> so that it can be passed to the method.