I got error (org.joor.ReflectException: java.lang.NoSuchFieldException: service()) in passing enum in funcition like there was no field service. My enum is not static is this a problem? I dont really see problem in code. I have two enum class one take values from another one.
public enum Modules {CONNECTOR_CLIENT("E", "A", "C");
public final String section;
public final String service;
public final String module;
Modules(String service, String section, String module) {
this.service = service;
this.section = section;
this.module = module;
}
public enum ModuleData {CONNECTOR_CLIENT(Modules.CONNECTOR_CLIENT.get(), ModulesLinks.CONNECTOR_CLIENT.get(), ModuleLogs.CONNECTOR_CLIENT.get()),;
public final LinkedHashMap menuModules;
public final LinkedHashMap link;
public final Boolean oldModule;
ModuleData(LinkedHashMap menuModules, LinkedHashMap link, Boolean oldModule) {
this.menuModules = menuModules;
this.link = link;
this.oldModule = oldModule;
}
public String module() {
return menuModules.get("module").toString();
}
public String link() {
return String.valueOf(link.get("link"));
}
public String service() {
return menuModules.get("service").toString();
}
public String section() {
return menuModules.get("section").toString();
}
public Boolean newModule() {
return oldModule;
}
Iterate in class
public void moveToModule(ModuleData moduleData, String browser) throws Exception {
try {
log.info(moduleData.service() + " " +
moduleData.section() + " " +
moduleData.module() + " " + moduleData.link());}
moveToModule(ModuleData.CUSTOMER_FILE, testSuite);
Aucun commentaire:
Enregistrer un commentaire