Accurest is now able to override existing file
This commit is contained in:
@@ -50,7 +50,7 @@ class TestGenerator {
|
||||
Files.createDirectories(testBaseDir)
|
||||
def classPath = Paths.get(testBaseDir.toString(), capitalize(it.name) + getTestClassExtension()).toAbsolutePath()
|
||||
def classBytes = buildClass(it, packageName).bytes
|
||||
Files.write(classPath, classBytes, StandardOpenOption.CREATE)
|
||||
Files.write(classPath, classBytes, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class SpockMethodBodyBuilder {
|
||||
if (stubDefinition.request.bodyPatterns) {
|
||||
String matches = stubDefinition.request.bodyPatterns[0].matches
|
||||
matches = matches.replaceAll('\\\\', '');
|
||||
blockBuilder.addLine(".body('${JsonOutput.toJson(matches)}')")
|
||||
blockBuilder.addLine(".body('$matches')")
|
||||
}
|
||||
|
||||
blockBuilder.unindent().endBlock().addEmptyLine()
|
||||
|
||||
Reference in New Issue
Block a user