@Test
    @ConfiguredWithCode("ConfigureLabels.yml")
    void shouldExportLabelAtoms(JenkinsConfiguredWithCodeRule j) throws Exception {
        Objects.requireNonNull(Jenkins.get().getLabelAtom("label1"))
                .getProperties()
                .add(new TestProperty(1));

        final ByteArrayOutputStream out = new ByteArrayOutputStream();
        ConfigurationAsCode.get().export(out);
        final String exported = out.toString();

        String content = FileUtils.readFileToString(
                new File(getClass()
                        .getResource("ExpectedLabelsConfiguration.yml")
                        .toURI()),
                "UTF-8");
        assertThat(exported, containsString(content));
    }
@author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
test-harness/src/test/java/io/jenkins/plugins/casc/core/JenkinsConfiguratorTest.java