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 old test is still valid #1678

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

Check if old test is still valid #1678

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

Comments

@jan-vcapgemini
Copy link
Collaborator

Check:

@Test
public void testLoadEnumClass() throws Exception {
// Mocking
Object containerInput = createTestDataAndConfigureMock();
// Useful to see generates if necessary, comment the generationRootFolder above then
File generationRootFolder = this.tmpFolder.newFolder("generationRootFolder");
// pre-processing
File templatesFolder = new File(testFileRootPath + "templates");
CobiGen target = CobiGenFactory.create(templatesFolder.toURI(), true);
List<TemplateTo> templates = target.getMatchingTemplates(containerInput);
// Execution
GenerationReportTo report = target.generate(containerInput, templates.get(1),
Paths.get(generationRootFolder.toURI()), false);
// Verification
File expectedResult = new File(testFileRootPath, "expected/Test2.java");
File generatedFile = new File(generationRootFolder, "com/devonfw/Test2.java");
assertThat(report).isSuccessful();
assertThat(generatedFile).exists();
assertThat(generatedFile).isFile().hasSameContentAs(expectedResult);
}

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