@Test
    public void roundTripTest(JenkinsRule r) throws Throwable {
        String resourcePath = configResource();
        String resourceContent = getResourceContent(resourcePath);

        assertNotNull(resourcePath);
        assertNotNull(resourceContent);

        // Configure and validate
        configureWithResource(resourcePath);
        assertConfiguredAsExpected(r, resourceContent);

        // Check config is valid via Web UI
        String jenkinsConf = getResourceContent(resourcePath);
        assertConfigViaWebUI(r, jenkinsConf);

        // Apply configuration via Web UI
        applyConfigViaWebUI(r, jenkinsConf);
        assertConfiguredAsExpected(r, resourceContent);

        // Configure Jenkins default JCasC file with the config file. It's already established, we check if applied
        // looking at the logs.
        putConfigInHome(r, jenkinsConf);

        // Start recording the logs just before restarting, to avoid capture the previous startup. We're look there
        // if the "magic token" is there
        try (LogRecorder recorder =
                new LogRecorder().record("io.jenkins.plugins.casc", Level.FINER).capture(2048)) {
            // Restart the testing instance
            r.restart();

            // Verify the log shows it's configured
            assertLogAsExpected(recorder, stringInLogExpected());
        }

        // Verify the configuration set at home/jenkins.yaml is loaded
        assertConfiguredAsExpected(r, resourceContent);
    }
1. Configure the instance with the {@link #configResource()} implemented. 2. Check it was
configured correctly. 3. Check the configuration is valid via Web UI. 4. Apply the
configuration via Web UI. 5. Write the configuration to $JENKINS_HOME/jenkins.yaml. 6.
Restart Jenkins. 7. Check the {@link #stringInLogExpected()} is set during the restart.

@throws IOException If an exception is thrown managing resources or files.
test-harness/src/main/java/io/jenkins/plugins/casc/misc/junit/jupiter/AbstractRoundTripTest.java