Class SafeJenkins

java.lang.Object
org.jenkinsci.plugins.pollmailboxtrigger.SafeJenkins

public final class SafeJenkins extends Object

This class provides a way for us to invoke the Jenkins.getInstance() method, during testing, without it throwing NoSuchMethod errors. Currently this method throws the following error: 'java.lang.NoSuchMethodError: hudson.util.XStream2.getConverterRegistry()Lcom/thoughtworks/xstream/converters/ConverterRegistry;'.

Unfortunately this method is invoked in many places, often nested within other static methods. This makes mocking very difficult/impossible. So, I've fashioned the following class to address these issues.