can we write test cases for setAddr() method, because it is private void method, can one please help me?
class WCfg {
private void setAddr(Cfg cfg, String... arg)
throws Exception {
try {
} catch (Exception e) {
throw new Exception("Invalid IP address.", e);
}
}
public String process(String... arg) throws Exception {
MCfg mCfg = new MCfg();
try {
setAddr(mCfg, arg);
} catch (Exception e) {
return "Wrong argument format.";
}
cfg.write();
return "success";
}
}