private void assertConfigViaWebUI(String jenkinsConfig) throws Exception {
        // The UI requires the path to the config file
        File f = tempFolder.newFile();
        writeToFile(jenkinsConfig, f.getAbsolutePath());

        // Call the check url
        JenkinsRule.WebClient client = r.j.createWebClient();
        WebRequest request = new WebRequest(client.createCrumbedUrl("configuration-as-code/checkNewSource"), POST);
        NameValuePair param = new NameValuePair("newSource", f.toURI().toURL().toExternalForm());
        request.setRequestParameters(Collections.singletonList(param));
        WebResponse response = client.loadWebResponse(request);
        assertEquals("Failed to POST to " + request.getUrl().toString(), 200, response.getStatusCode());
        String res = response.getContentAsString();
        assertThat(res, containsString("The configuration can be applied"));
    }
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/RoundTripAbstractTest.java