@Override
    public void setup() throws Exception {
        Class<?> enclosingClass = getEnclosingClass();

        if (!enclosingClass.isAnnotationPresent(JmhBenchmark.class)) {
            throw new IllegalStateException("The enclosing class must be annotated with @JmhBenchmark");
        }

        String config = Objects.requireNonNull(
                        getEnclosingClass().getResource(getResourcePath()), "Unable to find YAML config file")
                .toExternalForm();
        try {
            ConfigurationAsCode.get().configure(config);
        } catch (ConfiguratorException e) {
            LOGGER.log(Level.SEVERE, "Unable to configure using configuration as code. Aborting.");
            terminateJenkins();
            throw e; // causes JMH to abort benchmark
        }
    }
Setups the Jenkins instance using configuration as code
available through the {@link CascJmhBenchmarkState#getResourcePath()}.

@throws ConfiguratorException when unable to configure
test-harness/src/main/java/io/jenkins/plugins/casc/misc/jmh/CascJmhBenchmarkState.java