Skip to content

Check if old test is still valid #1678

@jan-vcapgemini

Description

@jan-vcapgemini

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);
}

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