forked from loafle/openapi-generator-original
added writeOptional method to avoid clobbering files
This commit is contained in:
@@ -164,8 +164,8 @@ public class DefaultGeneratorTest {
|
||||
changeContent(order);
|
||||
//delete file
|
||||
final File pom = new File(output, POM_FILE);
|
||||
if (!pom.delete()) {
|
||||
fail();
|
||||
if (pom.exists() && !pom.delete()) {
|
||||
fail("it doesn't delete");
|
||||
}
|
||||
|
||||
//generate content third time with skipOverwrite flag, so changed file should not be rewritten
|
||||
@@ -173,7 +173,8 @@ public class DefaultGeneratorTest {
|
||||
codegenConfig.setSkipOverwrite(true);
|
||||
new DefaultGenerator().opts(clientOptInput).generate();
|
||||
assertEquals(FileUtils.readFileToString(order, StandardCharsets.UTF_8), TEST_SKIP_OVERWRITE);
|
||||
assertTrue(pom.exists());
|
||||
// Disabling this check, it's not valid with the DefaultCodegen.writeOptional(...) arg
|
||||
// assertTrue(pom.exists());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user