DDConfigUpdater { public String getWorkitemResolver(String value, String defaultResolver) { if (value.trim().toLowerCase().startsWith(MVEL_PREFIX)) { return MVEL_PREFIX.substring(0, MVEL_PREFIX.length() - 1); } else if (value.trim().toLowerCase().startsWith(REFLECTION_PREFIX)) { return REFLECTION_PREFIX.substring(0, REFLECTION_PREFIX.length() - 1); } else { if (defaultResolver == null || defaultResolver.trim().isEmpty()) { return DEFAULT_RESOLVER; } else { return defaultResolver; } } } DDConfigUpdater(); @Inject  DDConfigUpdater(DDEditorService ddEditorService,
                           KieModuleService moduleService,
                           DDConfigUpdaterHelper configUpdaterHelper); void processResourceAdd(@Observes final ResourceAddedEvent resourceAddedEvent); void processResourceUpdate(@Observes final ResourceUpdatedEvent resourceUpdatedEvent); void processWorkitemInstall(@Observes final DesignerWorkitemInstalledEvent workitemInstalledEvent); void processServiceTaskEvent(@Observes final ServiceTaskResourceEvent serviceResourceEvent); String parseWorkitemValue(String value); String getWorkitemResolver(String value,
                                      String defaultResolver); boolean isValidWorkitem(String name, String value);  }
@Test public void testGetWorkitemResolver() { assertEquals("mvel", ddConfigUpdater.getWorkitemResolver("new com.myhandlers.MyHandler()", "mvel")); assertEquals("mvel", ddConfigUpdater.getWorkitemResolver("mvel:new com.myhandlers.MyHandler()", "reflection")); assertEquals("reflection", ddConfigUpdater.getWorkitemResolver("reflection:new com.myhandlers.MyHandler()", "mvel")); assertEquals("reflection", ddConfigUpdater.getWorkitemResolver("reflection:new com.myhandlers.MyHandler()", "")); assertEquals("reflection", ddConfigUpdater.getWorkitemResolver("new com.myhandlers.MyHandler()", "")); assertEquals("reflection", ddConfigUpdater.getWorkitemResolver("new com.myhandlers.MyHandler()", null)); }