Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if adapt monolithic templates test is valid #1681

Open
jan-vcapgemini opened this issue Apr 6, 2023 · 0 comments
Open

Check if adapt monolithic templates test is valid #1681

jan-vcapgemini opened this issue Apr 6, 2023 · 0 comments

Comments

@jan-vcapgemini
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant