Skip to content

Check if adapt monolithic templates test is valid #1681

@jan-vcapgemini

Description

@jan-vcapgemini

Check:

/**
* Test of adapt templates with old CobiGen_Templates project existing
*
* @throws IOException if an Exception occurs
*/
@Test
public void adaptTemplatesWithOldConfiguration() throws IOException {
String testFileRootPathMonolithicTemplates = apiTestsRootPath + "AdaptMonolithicTemplatesTest/";
Path cobiGenHomeMonolithicTemplates = this.tempFolder.newFolder("playground", "templatesMonolithicHome").toPath();
FileUtils.copyDirectory(new File(testFileRootPathMonolithicTemplates), cobiGenHomeMonolithicTemplates.toFile());
Path cobigenTemplatesParent = cobiGenHomeMonolithicTemplates
.resolve(ConfigurationConstants.CONFIG_PROPERTY_TEMPLATES_PATH);
Path cobigenTemplatesProject = cobigenTemplatesParent.resolve(ConfigurationConstants.COBIGEN_TEMPLATES);
TemplateAdapter templateAdapter = new TemplateAdapterImpl(cobigenTemplatesParent);
assertThrows(UpgradeTemplatesNotificationException.class, () -> {
templateAdapter.adaptTemplates();
});
assertThat(cobigenTemplatesProject).exists().isDirectory();
assertThat(cobigenTemplatesProject.resolve(ConfigurationConstants.TEMPLATE_RESOURCE_FOLDER)).exists().isDirectory();
assertThat(cobigenTemplatesProject.resolve("src/main/java")).exists().isDirectory();
}
}

Make sure that binaries used in this test get replaced with a test project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions