I have method that I want to test. It's input parameter is a list of objects of a private static class
Class Invoker{
public String method1(String inp){
ArrayList<InnerClass> params = new ArrayList<>();
params.add(new InnerClass("some value"));
String op = method2(params);
//other implementation
}
public String method2(ArrayList<InnerClass> list){
//method implementation
}
private static class InnerClass {
private String var1;
public InnerClass(String str){
super();
this.str = str;
}
}
}
Now, I want to write a test case for method 'method1'. The issue I'm facing is that while testing, I'm not able to create the ArrayList in the test class.