Test suffix is used also in class name
(not only in file name)
This commit is contained in:
@@ -28,8 +28,7 @@ class FileSaver {
|
||||
|
||||
Path testBaseDir = Paths.get(targetDirectory.absolutePath, NamesUtil.packageToDirectory(packageName))
|
||||
Files.createDirectories(testBaseDir)
|
||||
Path classPath = Paths.get(testBaseDir.toString(), capitalize(fileName) + framework.classNameSuffix + framework.classExtension)
|
||||
.toAbsolutePath()
|
||||
Path classPath = Paths.get(testBaseDir.toString(), capitalize(fileName) + framework.classExtension).toAbsolutePath()
|
||||
log.info("Creating new class file [$classPath]")
|
||||
Files.write(classPath, classBytes, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class TestGenerator {
|
||||
return new File(configProperties.contractsDslDir, it)
|
||||
}
|
||||
if (filesToClass.size()) {
|
||||
def className = afterLast(includedDirectoryRelativePath, File.separator)
|
||||
def className = afterLast(includedDirectoryRelativePath, File.separator) + configProperties.targetFramework.classNameSuffix
|
||||
def classBytes = generator.buildClass(filesToClass, className, packageNameForClass).bytes
|
||||
saver.saveClassFile(className, packageNameForClass, classBytes)
|
||||
counter.incrementAndGet()
|
||||
|
||||
@@ -32,7 +32,7 @@ class TestGeneratorSpec extends Specification {
|
||||
when:
|
||||
testGenerator.generateTestClasses("com.ofg")
|
||||
then:
|
||||
1 * classGenerator.buildClass(_, 'different', _) >> "qwerty"
|
||||
1 * classGenerator.buildClass(_, 'differentSpec', _) >> "qwerty"
|
||||
}
|
||||
|
||||
def "should ignore file"() {
|
||||
@@ -46,6 +46,6 @@ class TestGeneratorSpec extends Specification {
|
||||
when:
|
||||
testGenerator.generateTestClasses("com.ofg")
|
||||
then:
|
||||
1 * classGenerator.buildClass({ it.size() == 1 }, 'other', _) >> "sample.groovy"
|
||||
1 * classGenerator.buildClass({ it.size() == 1 }, 'otherSpec', _) >> "sample.groovy"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class BasicFunctionalSpec extends IntegrationSpec {
|
||||
then:
|
||||
fileExists('build.gradle')
|
||||
when:
|
||||
def result = runTasksSuccessfully('check')
|
||||
def result = runTasksSuccessfully('clean', 'check') //clean to remove accidental output when importing SimpleBoot into Idea
|
||||
then:
|
||||
result.wasExecuted(":generateWiremockClientStubs")
|
||||
result.wasExecuted(":generateAccurest")
|
||||
@@ -25,7 +25,7 @@ class BasicFunctionalSpec extends IntegrationSpec {
|
||||
fileExists("build/production/bootSimple-stubs/repository/mappings/pairId/colleratePlacesFromTweet.json")
|
||||
|
||||
and: "generated tests executed"
|
||||
fileExists("build/test-results/TEST-accurest.PairId.xml")
|
||||
fileExists("build/test-results/TEST-accurest.PairIdSpec.xml")
|
||||
}
|
||||
|
||||
def "should generate valid client json stubs for simple input"() {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
rootProject.name='bootSimple'
|
||||
Reference in New Issue
Block a user