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.
Check:
cobigen/cobigen/cobigen-core-systemtest/src/test/java/com/devonfw/cobigen/systemtest/TemplateProcessingTest.java
Lines 115 to 142 in 5af0844
Make sure that binaries used in this test get replaced with a test project.