'How to design void method junit test?

public class ParmsData {

    @Autowired
    private ParamsCache paramsCache;

    private Map<String, List<String>> beanData = Collections.synchronizedMap(new HashMap<>());

    public void init(){
        this.beanData = Collections.synchronizedMap(paramsCache.allParams().stream()
                .collect(Collectors.toMap(FxParams:: getSysPara, param -> Arrays.stream(param.getSysParaValue().split(",")).collect(Collectors.toList()))));
    }
}
  1. How to design init() method junit test?
  2. Please give me the exmple code thanks.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source