I am trying to learn junit testing and mockito. I would like to know how to write test cases if there are Maps and private method reference.
@Autowired
AppProps props;
public Foo checkStatus(){
Foo foo = new Foo();
foo.setStatus("Up");
Map<String,List<String>> childStatusList = getChildStatus();
foo.setChildStatus(childStatusList);
return foo;
}
private Map<String,List<String>> getChildStatus(){
Map<String,List<String>> healthMap = new LinkedHashMap<>();
String url = "https://google.com";
for(Entry<Integer,List<String>> entrySet: props.getMap().entrySet()){
for(String str : entrySet.getValue()){
healthMap.put("Up", Arrays.asList(url));
}
}
}