Search in sources :

Example 1 with JcascManage

use of org.jenkinsci.test.acceptance.plugins.configuration_as_code.JcascManage in project acceptance-test-harness by jenkinsci.

the class ConfigurationAsCodeTest method loadAndReload.

@Test
public void loadAndReload() {
    final String EXPECTED_DESC = "JCasC populated description";
    JcascManage jm = new JcascManage(jenkins);
    jm.open();
    jm.configure(resource("/configuration_as_code/trivial.yaml").asFile().getAbsolutePath());
    assertThat(jenkins.open(), hasContent(EXPECTED_DESC));
    JenkinsConfig gc = jenkins.getConfigPage();
    gc.configure(() -> gc.setDescription("Changed"));
    assertThat(jenkins.open(), Matchers.not(hasContent(EXPECTED_DESC)));
    jm.open();
    jm.reload();
    assertThat(jenkins.open(), hasContent(EXPECTED_DESC));
}
Also used : JenkinsConfig(org.jenkinsci.test.acceptance.po.JenkinsConfig) JcascManage(org.jenkinsci.test.acceptance.plugins.configuration_as_code.JcascManage) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Aggregations

AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)1 JcascManage (org.jenkinsci.test.acceptance.plugins.configuration_as_code.JcascManage)1 JenkinsConfig (org.jenkinsci.test.acceptance.po.JenkinsConfig)1 Test (org.junit.Test)1