From 619b84f73985c8cca8c6f05f113e1fbd0dc4f8e1 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Sun, 10 Nov 2024 19:07:38 -0500 Subject: [PATCH] fix failing tests after Gradle plugin configuration consolidation --- .../forge/ApplicationContextSpec.groovy | 2 +- .../org/grails/forge/BuildBuilder.groovy | 1 + .../GradleDependencyComparatorSpec.groovy | 28 +++++------ .../forge/build/gradle/GradleSpec.groovy | 46 +------------------ .../asciidoctor/AsciidoctorSpec.groovy | 3 +- .../assetPipeline/AssetPipelineSpec.groovy | 14 +----- .../forge/feature/cache/EHCacheSpec.groovy | 2 +- .../feature/database/EmbeddedMongoSpec.groovy | 2 +- .../feature/database/HibernateGormSpec.groovy | 14 +++--- .../feature/database/MongoGormSpec.groovy | 6 +-- .../feature/database/MongoSyncSpec.groovy | 4 +- .../forge/feature/database/MySQLSpec.groovy | 2 +- .../feature/database/Neo4JGormSpec.groovy | 2 +- .../feature/database/PostgresSpec.groovy | 2 +- .../feature/database/SQLServerSpec.groovy | 2 +- .../database/TestContainersSpec.groovy | 26 +++++------ .../feature/grails/GrailsBaseSpec.groovy | 6 +-- .../feature/grails/GrailsConsoleSpec.groovy | 2 +- .../grails/GrailsDefaultPluginsSpec.groovy | 10 ++-- .../grails/GrailsGradlePluginSpec.groovy | 10 ++-- .../grails/GrailsWebConsoleSpec.groovy | 2 +- .../grailsProfiles/GrailsProfilesSpec.groovy | 3 +- .../feature/lang/GrailsApplicationSpec.groovy | 2 +- .../logging/LogbackGroovyConfigSpec.groovy | 4 +- .../forge/feature/logging/LogbackSpec.groovy | 2 +- .../micronaut/MicronautHttpClientSpec.groovy | 2 +- .../MicronautInjectGroovySpec.groovy | 4 +- .../reloading/SpringBootDevToolsSpec.groovy | 2 +- .../feature/spring/SpringBootSpec.groovy | 22 ++++----- .../grails/forge/feature/test/GebSpec.groovy | 20 ++++---- .../forge/feature/test/JUnitSpec.groovy | 2 +- .../forge/feature/test/SpockSpec.groovy | 2 +- .../forge/feature/view/GrailsGspSpec.groovy | 12 ++--- .../forge/feature/view/ScaffoldingSpec.groovy | 4 +- .../feature/view/json/ViewJsonSpec.groovy | 22 ++++----- .../feature/view/json/ViewMarkupSpec.groovy | 12 ++--- .../forge/feature/web/GrailsWebSpec.groovy | 2 +- .../scaffolding/ScaffoldingSpec.groovy | 14 +++--- 38 files changed, 130 insertions(+), 187 deletions(-) diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/ApplicationContextSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/ApplicationContextSpec.groovy index 0ceb6063..a3668d8f 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/ApplicationContextSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/ApplicationContextSpec.groovy @@ -34,7 +34,7 @@ abstract class ApplicationContextSpec extends Specification implements ProjectFi for (String line : lines) { if (line.contains(groupArtifactId)) { String str = line.substring(line.indexOf(groupArtifactId) + groupArtifactId.length() + ":".length()) - String version = str.substring(0, str.indexOf("\")")) + String version = str.substring(0, str.indexOf("\"")) return Optional.of(new SemanticVersion(version)) } } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/BuildBuilder.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/BuildBuilder.groovy index a4af1118..494dc8ff 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/BuildBuilder.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/BuildBuilder.groovy @@ -101,6 +101,7 @@ class BuildBuilder implements ProjectFixture, ContextFixture { String renderBuildSrc() { List featureNames = this.features ?: [] + featureNames.add("gradle-build-src") TestFramework testFramework = this.testFramework ?: TestFramework.SPOCK ApplicationType type = this.applicationType ?: ApplicationType.WEB Project project = this.project ?: buildProject() diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/build/dependencies/GradleDependencyComparatorSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/build/dependencies/GradleDependencyComparatorSpec.groovy index da1c4bc0..6dd7d5f7 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/build/dependencies/GradleDependencyComparatorSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/build/dependencies/GradleDependencyComparatorSpec.groovy @@ -32,23 +32,23 @@ class GradleDependencyComparatorSpec extends Specification { dependencies.sort(GradleDependency.COMPARATOR) then: - "${str(dependencies[0])}" == 'implementation("io.micronaut:micronaut-http-client")' - "${str(dependencies[1])}" == 'implementation("io.micronaut:micronaut-runtime")' - "${str(dependencies[2])}" == 'implementation("io.micronaut:micronaut-validation")' - "${str(dependencies[3])}" == 'implementation("io.micronaut.sql:micronaut-jdbc-hikari")' - "${str(dependencies[4])}" == 'implementation("io.swagger.core.v3:swagger-annotations")' - "${str(dependencies[5])}" == 'implementation("jakarta.annotation:jakarta.annotation-api")' - "${str(dependencies[6])}" == 'compileOnly("io.micronaut.openapi:micronaut-openapi")' - "${str(dependencies[7])}" == 'console("org.grails:grails-console")' - "${str(dependencies[8])}" == 'runtimeOnly("ch.qos.logback:logback-classic")' - "${str(dependencies[9])}" == 'runtimeOnly("mysql:mysql-connector-java")' - "${str(dependencies[10])}" == 'testImplementation("org.testcontainers:junit-jupiter")' - "${str(dependencies[11])}" == 'testImplementation("org.testcontainers:mysql")' - "${str(dependencies[12])}" == 'testImplementation("org.testcontainers:testcontainers")' + "${str(dependencies[0])}" == 'implementation "io.micronaut:micronaut-http-client"' + "${str(dependencies[1])}" == 'implementation "io.micronaut:micronaut-runtime"' + "${str(dependencies[2])}" == 'implementation "io.micronaut:micronaut-validation"' + "${str(dependencies[3])}" == 'implementation "io.micronaut.sql:micronaut-jdbc-hikari"' + "${str(dependencies[4])}" == 'implementation "io.swagger.core.v3:swagger-annotations"' + "${str(dependencies[5])}" == 'implementation "jakarta.annotation:jakarta.annotation-api"' + "${str(dependencies[6])}" == 'compileOnly "io.micronaut.openapi:micronaut-openapi"' + "${str(dependencies[7])}" == 'console "org.grails:grails-console"' + "${str(dependencies[8])}" == 'runtimeOnly "ch.qos.logback:logback-classic"' + "${str(dependencies[9])}" == 'runtimeOnly "mysql:mysql-connector-java"' + "${str(dependencies[10])}" == 'testImplementation "org.testcontainers:junit-jupiter"' + "${str(dependencies[11])}" == 'testImplementation "org.testcontainers:mysql"' + "${str(dependencies[12])}" == 'testImplementation "org.testcontainers:testcontainers"' } private static String str(GradleDependency dependency) { - "${dependency.getConfiguration().toString()}(\"${dependency.groupId}:${dependency.artifactId}\")" + "${dependency.getConfiguration().toString()} \"${dependency.groupId}:${dependency.artifactId}\"" } private static GradleDependency dep(Dependency.Builder dependency, GeneratorContext ctx) { diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/build/gradle/GradleSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/build/gradle/GradleSpec.groovy index 1b4008b9..ed6d616e 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/build/gradle/GradleSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/build/gradle/GradleSpec.groovy @@ -34,52 +34,10 @@ class GradleSpec extends ApplicationContextSpec implements CommandOutputFixture void "test settings.gradle"() { given: - final def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11)) - final String settingsGradle = output["settings.gradle"] - - expect: - settingsGradle.contains("pluginManagement") - settingsGradle.contains("repositories") - settingsGradle.contains("mavenLocal()") - settingsGradle.contains("maven { url \"https://repo.grails.org/grails/core/\" }") - settingsGradle.contains("gradlePluginPortal()") - settingsGradle.contains("id \"org.grails.grails-web\" version \"6.2.1\"") - settingsGradle.contains("id \"org.grails.grails-gsp\" version \"6.2.1\"") - settingsGradle.contains("id \"com.bertramlabs.asset-pipeline\" version \"4.3.0\"") - } - - void "test settings.gradle for REST-API"() { - given: - final def output = generate(ApplicationType.REST_API, new Options(TestFramework.SPOCK, JdkVersion.JDK_11)) - final String settingsGradle = output["settings.gradle"] - - expect: - settingsGradle.contains("pluginManagement") - settingsGradle.contains("repositories") - settingsGradle.contains("mavenLocal()") - settingsGradle.contains("maven { url \"https://repo.grails.org/grails/core/\" }") - settingsGradle.contains("gradlePluginPortal()") - settingsGradle.contains("id \"org.grails.grails-web\" version \"6.2.1\"") - settingsGradle.contains("id \"org.grails.plugins.views-json\" version \"3.2.3\"") - !settingsGradle.contains("id \"org.grails.grails-gsp\" version \"6.2.1\"") - !settingsGradle.contains("id \"com.bertramlabs.asset-pipeline\" version \"4.3.0\"") - } - - void "test settings.gradle for REST-API for markup-views"() { - given: - final def output = generate(ApplicationType.REST_API, new Options(TestFramework.SPOCK, JdkVersion.JDK_11), ["views-markup"]) + final def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11), ["gradle-settings-file"]) final String settingsGradle = output["settings.gradle"] expect: - settingsGradle.contains("pluginManagement") - settingsGradle.contains("repositories") - settingsGradle.contains("mavenLocal()") - settingsGradle.contains("maven { url \"https://repo.grails.org/grails/core/\" }") - settingsGradle.contains("gradlePluginPortal()") - settingsGradle.contains("id \"org.grails.grails-web\" version \"6.2.1\"") - settingsGradle.contains("id \"org.grails.plugins.views-markup\" version \"3.2.3\"") - !settingsGradle.contains("id \"org.grails.plugins.views-json\" version \"3.2.3\"") - !settingsGradle.contains("id \"org.grails.grails-gsp\" version \"6.2.1\"") - !settingsGradle.contains("id \"com.bertramlabs.asset-pipeline\" version \"4.3.0\"") + settingsGradle.contains("rootProject.name") } } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/asciidoctor/AsciidoctorSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/asciidoctor/AsciidoctorSpec.groovy index 2c9ab388..cbd248d9 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/asciidoctor/AsciidoctorSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/asciidoctor/AsciidoctorSpec.groovy @@ -22,10 +22,9 @@ class AsciidoctorSpec extends ApplicationContextSpec implements CommandOutputFix given: final def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11), ["asciidoctor"]) final def buildGradle = output["build.gradle"] - final def settingGradle = output["settings.gradle"] expect: - settingGradle.contains("id \"org.asciidoctor.jvm.convert\" version \"4.0.0-alpha.1\"") + buildGradle.contains("id \"org.asciidoctor.jvm.convert\" version \"4.0.0-alpha.1\"") buildGradle.contains("apply from: \"gradle/asciidoc.gradle\"") } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/assetPipeline/AssetPipelineSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/assetPipeline/AssetPipelineSpec.groovy index 7b3414f5..47ca669d 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/assetPipeline/AssetPipelineSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/assetPipeline/AssetPipelineSpec.groovy @@ -20,18 +20,6 @@ class AssetPipelineSpec extends ApplicationContextSpec implements CommandOutputF features.contains("asset-pipeline-grails") } - void "test buildSrc is present for buildscript dependencies"() { - given: - final def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11)) - final def buildSrcBuildGradle = output["buildSrc/build.gradle"] - - expect: - buildSrcBuildGradle != null - buildSrcBuildGradle.contains("implementation(\"com.bertramlabs.plugins:asset-pipeline-gradle:4.3.0\")") - - } - - void "test dependencies are present for gradle"() { when: final String template = new BuildBuilder(beanContext) @@ -40,7 +28,7 @@ class AssetPipelineSpec extends ApplicationContextSpec implements CommandOutputF then: template.contains("id \"com.bertramlabs.asset-pipeline\"") - template.contains("runtimeOnly(\"com.bertramlabs.plugins:asset-pipeline-grails:4.3.0\")") + template.contains("runtimeOnly \"com.bertramlabs.plugins:asset-pipeline-grails:4.5.1\"") template.contains(''' assets { minifyJs = true diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/cache/EHCacheSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/cache/EHCacheSpec.groovy index efa94099..e3a6a2f3 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/cache/EHCacheSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/cache/EHCacheSpec.groovy @@ -27,7 +27,7 @@ class EHCacheSpec extends ApplicationContextSpec implements CommandOutputFixture .render() then: - template.contains('implementation("org.grails.plugins:cache-ehcache:3.0.0")') + template.contains('implementation "org.grails.plugins:cache-ehcache:3.0.0"') } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/EmbeddedMongoSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/EmbeddedMongoSpec.groovy index c1557ea7..133629a5 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/EmbeddedMongoSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/EmbeddedMongoSpec.groovy @@ -23,7 +23,7 @@ class EmbeddedMongoSpec extends ApplicationContextSpec implements CommandOutputF .render() then: - template.contains("testRuntimeOnly(\"org.grails.plugins:embedded-mongodb:2.0.1\")") + template.contains("testRuntimeOnly \"org.grails.plugins:embedded-mongodb:2.0.1\"") } void "test config"() { diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/HibernateGormSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/HibernateGormSpec.groovy index 91052970..d63552a1 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/HibernateGormSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/HibernateGormSpec.groovy @@ -29,9 +29,9 @@ class HibernateGormSpec extends ApplicationContextSpec implements CommandOutputF .render() then: - template.contains('implementation("org.grails.plugins:hibernate5")') - template.contains("runtimeOnly(\"org.apache.tomcat:tomcat-jdbc\")") - template.contains("runtimeOnly(\"com.h2database:h2\")") + template.contains('implementation "org.grails.plugins:hibernate5"') + template.contains("runtimeOnly \"org.apache.tomcat:tomcat-jdbc\"") + template.contains("runtimeOnly \"com.h2database:h2\"") } void "test dependencies are present for buildSrc"() { @@ -41,17 +41,17 @@ class HibernateGormSpec extends ApplicationContextSpec implements CommandOutputF .renderBuildSrc() then: - template.contains('implementation("org.grails.plugins:hibernate5:8.1.0")') + template.contains('implementation "org.grails.plugins:hibernate5:8.1.0"') } void "test buildSrc is present for buildscript dependencies"() { given: final def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11)) - final def buildSrcBuildGradle = output["buildSrc/build.gradle"] + final def buildGradle = output["build.gradle"] expect: - buildSrcBuildGradle != null - buildSrcBuildGradle.contains("implementation(\"org.grails.plugins:hibernate5:8.1.0\")") + buildGradle != null + buildGradle.contains("classpath \"org.grails.plugins:hibernate5:8.1.0\"") } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MongoGormSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MongoGormSpec.groovy index e214d543..949b87d0 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MongoGormSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MongoGormSpec.groovy @@ -41,7 +41,7 @@ class MongoGormSpec extends ApplicationContextSpec implements CommandOutputFixtu .render() then: - template.contains("implementation(\"org.grails.plugins:mongodb\")") + template.contains("implementation \"org.grails.plugins:mongodb\"") } void "test gorm mongodb with embedded-mongodb feature"() { @@ -51,8 +51,8 @@ class MongoGormSpec extends ApplicationContextSpec implements CommandOutputFixtu .render() then: - template.contains("implementation(\"org.grails.plugins:mongodb\")") - template.contains("testRuntimeOnly(\"org.grails.plugins:embedded-mongodb:2.0.1\")") + template.contains("implementation \"org.grails.plugins:mongodb\"") + template.contains("testRuntimeOnly \"org.grails.plugins:embedded-mongodb:2.0.1\"") } void "test config"() { diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MongoSyncSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MongoSyncSpec.groovy index c818075b..a60f39a3 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MongoSyncSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MongoSyncSpec.groovy @@ -33,7 +33,7 @@ class MongoSyncSpec extends ApplicationContextSpec implements CommandOutputFixtu .render() then: - template.contains('implementation("org.mongodb:mongodb-driver-sync:4.11.3")') - template.contains('testImplementation("org.testcontainers:mongodb")') + template.contains('implementation "org.mongodb:mongodb-driver-sync:4.11.3"') + template.contains('testImplementation "org.testcontainers:mongodb"') } } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MySQLSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MySQLSpec.groovy index cc7d654f..06d9d9ed 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MySQLSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MySQLSpec.groovy @@ -13,7 +13,7 @@ class MySQLSpec extends ApplicationContextSpec { .render() then: - template.contains('runtimeOnly("mysql:mysql-connector-java")') + template.contains('runtimeOnly "mysql:mysql-connector-java"') } void "test there can only be one of DatabaseDriverFeature"() { diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/Neo4JGormSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/Neo4JGormSpec.groovy index b56effa4..03e4978f 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/Neo4JGormSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/Neo4JGormSpec.groovy @@ -32,7 +32,7 @@ class Neo4JGormSpec extends ApplicationContextSpec implements CommandOutputFixtu .render() then: - template.contains("implementation(\"org.grails.plugins:neo4j\")") + template.contains("implementation \"org.grails.plugins:neo4j\"") } void "test config"() { diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/PostgresSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/PostgresSpec.groovy index 8991cebc..0325ce48 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/PostgresSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/PostgresSpec.groovy @@ -13,7 +13,7 @@ class PostgresSpec extends ApplicationContextSpec { .render() then: - template.contains('runtimeOnly("org.postgresql:postgresql")') + template.contains('runtimeOnly "org.postgresql:postgresql"') } void "test there can only be one of DatabaseDriverFeature"() { diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/SQLServerSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/SQLServerSpec.groovy index 658cf8ea..a2a0197f 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/SQLServerSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/SQLServerSpec.groovy @@ -13,7 +13,7 @@ class SQLServerSpec extends ApplicationContextSpec { .render() then: - template.contains('runtimeOnly("com.microsoft.sqlserver:mssql-jdbc")') + template.contains('runtimeOnly "com.microsoft.sqlserver:mssql-jdbc"') } void "test there can only be one of DatabaseDriverFeature"() { diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/TestContainersSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/TestContainersSpec.groovy index ab0e5a34..eaf96719 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/TestContainersSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/TestContainersSpec.groovy @@ -16,8 +16,8 @@ class TestContainersSpec extends ApplicationContextSpec { .render() then: - template.contains('testImplementation("org.testcontainers:mysql")') - template.contains('testImplementation("org.testcontainers:testcontainers")') + template.contains('testImplementation "org.testcontainers:mysql"') + template.contains('testImplementation "org.testcontainers:testcontainers"') } void "test postgres dependency is present for gradle"() { @@ -27,8 +27,8 @@ class TestContainersSpec extends ApplicationContextSpec { .render() then: - template.contains('testImplementation("org.testcontainers:postgresql")') - template.contains('testImplementation("org.testcontainers:testcontainers")') + template.contains('testImplementation "org.testcontainers:postgresql"') + template.contains('testImplementation "org.testcontainers:testcontainers"') } void "test sqlserver dependency is present for gradle"() { @@ -38,8 +38,8 @@ class TestContainersSpec extends ApplicationContextSpec { .render() then: - template.contains('testImplementation("org.testcontainers:mssqlserver")') - template.contains('testImplementation("org.testcontainers:testcontainers")') + template.contains('testImplementation "org.testcontainers:mssqlserver"') + template.contains('testImplementation "org.testcontainers:testcontainers"') } void "test mongo-sync dependency is present for gradle"() { @@ -49,8 +49,8 @@ class TestContainersSpec extends ApplicationContextSpec { .render() then: - template.contains('testImplementation("org.testcontainers:mongodb")') - template.contains('testImplementation("org.testcontainers:testcontainers")') + template.contains('testImplementation "org.testcontainers:mongodb"') + template.contains('testImplementation "org.testcontainers:testcontainers"') } void "test mongo-gorm dependency is present for gradle"() { @@ -60,8 +60,8 @@ class TestContainersSpec extends ApplicationContextSpec { .render() then: - template.contains('testImplementation("org.testcontainers:mongodb")') - template.contains('testImplementation("org.testcontainers:testcontainers")') + template.contains('testImplementation "org.testcontainers:mongodb"') + template.contains('testImplementation "org.testcontainers:testcontainers"') } void "test testcontainers core is present when no testcontainer modules are present for gradle"() { @@ -71,7 +71,7 @@ class TestContainersSpec extends ApplicationContextSpec { .render() then: - template.contains('testImplementation("org.testcontainers:testcontainers")') + template.contains('testImplementation "org.testcontainers:testcontainers"') } void "testframework dependency is present for gradle for feature #feature and spock framework"() { @@ -82,7 +82,7 @@ class TestContainersSpec extends ApplicationContextSpec { .render() then: - template.contains('testImplementation("org.testcontainers:spock")') + template.contains('testImplementation "org.testcontainers:spock"') where: feature << ["mongo-sync", "mysql", "postgres", "sqlserver"] @@ -97,7 +97,7 @@ class TestContainersSpec extends ApplicationContextSpec { .render() then: - template.contains('testImplementation("org.testcontainers:junit-jupiter")') + template.contains('testImplementation "org.testcontainers:junit-jupiter"') where: feature << ["mongo-sync", "mysql", "postgres", "sqlserver"] diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsBaseSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsBaseSpec.groovy index 80627b70..bf5f9d76 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsBaseSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsBaseSpec.groovy @@ -16,9 +16,9 @@ class GrailsBaseSpec extends BeanContextSpec implements CommandOutputFixture { def buildGradle = output['build.gradle'] then: - buildGradle.contains("implementation(\"org.grails:grails-core\")") - buildGradle.contains("implementation(\"org.grails:grails-web-boot\")") - buildGradle.contains("implementation(\"org.grails:grails-logging\")") + buildGradle.contains("implementation \"org.grails:grails-core\"") + buildGradle.contains("implementation \"org.grails:grails-web-boot\"") + buildGradle.contains("implementation \"org.grails:grails-logging\"") } void "test src/main directories are present"() { diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsConsoleSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsConsoleSpec.groovy index edd7a27b..58dc4e37 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsConsoleSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsConsoleSpec.groovy @@ -12,6 +12,6 @@ class GrailsConsoleSpec extends BeanContextSpec { .render() then: - template.contains("console(\"org.grails:grails-console\")") + template.contains("console \"org.grails:grails-console\"") } } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsDefaultPluginsSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsDefaultPluginsSpec.groovy index 90563626..cb3f3ee9 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsDefaultPluginsSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsDefaultPluginsSpec.groovy @@ -15,11 +15,11 @@ class GrailsDefaultPluginsSpec extends ApplicationContextSpec implements Command final String buildGradle = output["build.gradle"] expect: - buildGradle.contains("implementation(\"org.grails:grails-plugin-rest\")") - buildGradle.contains("implementation(\"org.grails:grails-plugin-databinding\")") - buildGradle.contains("implementation(\"org.grails:grails-plugin-i18n\")") - buildGradle.contains("implementation(\"org.grails:grails-plugin-services\")") - buildGradle.contains("implementation(\"org.grails:grails-plugin-interceptors\")") + buildGradle.contains("implementation \"org.grails:grails-plugin-rest\"") + buildGradle.contains("implementation \"org.grails:grails-plugin-databinding\"") + buildGradle.contains("implementation \"org.grails:grails-plugin-i18n\"") + buildGradle.contains("implementation \"org.grails:grails-plugin-services\"") + buildGradle.contains("implementation \"org.grails:grails-plugin-interceptors\"") } void "test i18n message properties files are present"() { diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsGradlePluginSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsGradlePluginSpec.groovy index 99474677..cb54f0a6 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsGradlePluginSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsGradlePluginSpec.groovy @@ -26,17 +26,17 @@ class GrailsGradlePluginSpec extends BeanContextSpec implements CommandOutputFix .renderBuildSrc() then: - template.contains('implementation("org.grails:grails-gradle-plugin:6.2.1")') + template.contains('implementation "org.grails:grails-gradle-plugin:6.2.1"') } void "test buildSrc is present for buildscript dependencies"() { given: final def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11)) - final def buildSrcBuildGradle = output["buildSrc/build.gradle"] + final def buildGradle = output["build.gradle"] expect: - buildSrcBuildGradle != null - buildSrcBuildGradle.contains("implementation(\"org.grails:grails-gradle-plugin:6.2.1\")") + buildGradle != null + buildGradle.contains("classpath \"org.grails:grails-gradle-plugin:6.2.1\"") } @@ -47,7 +47,7 @@ class GrailsGradlePluginSpec extends BeanContextSpec implements CommandOutputFix .render() then: - template.contains("id \"org.grails.grails-plugin\"") + template.contains("apply plugin: \"org.grails.grails-plugin\"") } } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsWebConsoleSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsWebConsoleSpec.groovy index 19578268..2fa343fb 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsWebConsoleSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grails/GrailsWebConsoleSpec.groovy @@ -22,7 +22,7 @@ class GrailsWebConsoleSpec extends BeanContextSpec { .render() then: - template.contains("runtimeOnly(\"org.grails.plugins:grails-console:2.1.1\")") + template.contains("runtimeOnly \"org.grails.plugins:grails-console:2.1.1\"") } void "test config"() { diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grailsProfiles/GrailsProfilesSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grailsProfiles/GrailsProfilesSpec.groovy index b9fa872c..515793c5 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/grailsProfiles/GrailsProfilesSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/grailsProfiles/GrailsProfilesSpec.groovy @@ -2,7 +2,6 @@ package org.grails.forge.feature.grailsProfiles import org.grails.forge.ApplicationContextSpec import org.grails.forge.application.ApplicationType -import org.grails.forge.application.generator.GeneratorContext import org.grails.forge.fixture.CommandOutputFixture import org.grails.forge.options.JdkVersion import org.grails.forge.options.Options @@ -19,7 +18,7 @@ class GrailsProfilesSpec extends ApplicationContextSpec implements CommandOutput then: output.containsKey("build.gradle") def build = output.get("build.gradle") - build.contains("profile(\"org.grails.profiles:${applicationType.name.replace("_", "-")}\")") + build.contains("profile \"org.grails.profiles:${applicationType.name.replace("_", "-")}\"") where: applicationType << ApplicationType.values().toList() diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/lang/GrailsApplicationSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/lang/GrailsApplicationSpec.groovy index 41766499..8a25098a 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/lang/GrailsApplicationSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/lang/GrailsApplicationSpec.groovy @@ -28,7 +28,7 @@ class GrailsApplicationSpec extends BeanContextSpec implements CommandOutputFixt def buildGradle = output['build.gradle'] then: - buildGradle.contains('mainClass.set("example.grails.Application")') + buildGradle.contains('mainClass.set("example.grails.Application"') where: applicationType << [ApplicationType.WEB, ApplicationType.REST_API] diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/logging/LogbackGroovyConfigSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/logging/LogbackGroovyConfigSpec.groovy index aab15b42..18282669 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/logging/LogbackGroovyConfigSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/logging/LogbackGroovyConfigSpec.groovy @@ -16,8 +16,8 @@ class LogbackGroovyConfigSpec extends ApplicationContextSpec implements CommandO then: output.containsKey("build.gradle") def build = output.get("build.gradle") - build.contains("implementation(\"org.grails:grails-logging\")") - build.contains("implementation(\"io.github.virtualdogbert:logback-groovy-config:1.12.4\")") + build.contains("implementation \"org.grails:grails-logging\"") + build.contains("implementation \"io.github.virtualdogbert:logback-groovy-config:1.12.4\"") where: applicationType << ApplicationType.values().toList() diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/logging/LogbackSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/logging/LogbackSpec.groovy index 00ac0600..14be25b9 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/logging/LogbackSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/logging/LogbackSpec.groovy @@ -16,7 +16,7 @@ class LogbackSpec extends ApplicationContextSpec implements CommandOutputFixture then: output.containsKey("build.gradle") def build = output.get("build.gradle") - build.contains("implementation(\"org.grails:grails-logging\")") + build.contains("implementation \"org.grails:grails-logging\"") where: applicationType << ApplicationType.values().toList() diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/micronaut/MicronautHttpClientSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/micronaut/MicronautHttpClientSpec.groovy index c2372e06..00a07e66 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/micronaut/MicronautHttpClientSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/micronaut/MicronautHttpClientSpec.groovy @@ -13,6 +13,6 @@ class MicronautHttpClientSpec extends BeanContextSpec { .render() then: - template.contains("implementation(\"io.micronaut:micronaut-http-client\")") + template.contains("implementation \"io.micronaut:micronaut-http-client\"") } } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/micronaut/MicronautInjectGroovySpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/micronaut/MicronautInjectGroovySpec.groovy index cfb2f57f..dc529a6a 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/micronaut/MicronautInjectGroovySpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/micronaut/MicronautInjectGroovySpec.groovy @@ -12,7 +12,7 @@ class MicronautInjectGroovySpec extends BeanContextSpec { .render() then: - template.contains("compileOnly(\"io.micronaut:micronaut-inject-groovy\")") - template.contains("testImplementation(\"io.micronaut:micronaut-inject-groovy\")") + template.contains("compileOnly \"io.micronaut:micronaut-inject-groovy\"") + template.contains("testImplementation \"io.micronaut:micronaut-inject-groovy\"") } } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/reloading/SpringBootDevToolsSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/reloading/SpringBootDevToolsSpec.groovy index 08033e84..349de446 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/reloading/SpringBootDevToolsSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/reloading/SpringBootDevToolsSpec.groovy @@ -24,7 +24,7 @@ class SpringBootDevToolsSpec extends ApplicationContextSpec implements CommandOu def build = output["build.gradle"] then: - build.contains("developmentOnly(\"org.springframework.boot:spring-boot-devtools\"") + build.contains("developmentOnly \"org.springframework.boot:spring-boot-devtools\"") where: applicationType << [ApplicationType.WEB, ApplicationType.REST_API] diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/spring/SpringBootSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/spring/SpringBootSpec.groovy index 5b8f61ae..818f4164 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/spring/SpringBootSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/spring/SpringBootSpec.groovy @@ -20,11 +20,11 @@ class SpringBootSpec extends BeanContextSpec implements CommandOutputFixture { final String build = output['build.gradle'] then: - build.contains("implementation(\"org.springframework.boot:spring-boot-starter\")") - build.contains("implementation(\"org.springframework.boot:spring-boot-starter-actuator\")") - build.contains("implementation(\"org.springframework.boot:spring-boot-starter-logging\")") - build.contains("implementation(\"org.springframework.boot:spring-boot-starter-validation\")") - build.contains("implementation(\"org.springframework.boot:spring-boot-autoconfigure\")") + build.contains("implementation \"org.springframework.boot:spring-boot-starter\"") + build.contains("implementation \"org.springframework.boot:spring-boot-starter-actuator\"") + build.contains("implementation \"org.springframework.boot:spring-boot-starter-logging\"") + build.contains("implementation \"org.springframework.boot:spring-boot-starter-validation\"") + build.contains("implementation \"org.springframework.boot:spring-boot-autoconfigure\"") where: applicationType << [ApplicationType.WEB, ApplicationType.REST_API, ApplicationType.WEB_PLUGIN] @@ -39,11 +39,11 @@ class SpringBootSpec extends BeanContextSpec implements CommandOutputFixture { final String build = output['build.gradle'] then: - !build.contains("implementation(\"org.springframework.boot:spring-boot-starter\")") - !build.contains("implementation(\"org.springframework.boot:spring-boot-starter-actuator\")") - build.contains("implementation(\"org.springframework.boot:spring-boot-starter-logging\")") - build.contains("implementation(\"org.springframework.boot:spring-boot-starter-validation\")") - build.contains("implementation(\"org.springframework.boot:spring-boot-autoconfigure\")") - !build.contains("implementation(\"org.springframework.boot:spring-boot-starter-tomcat\")") + !build.contains("implementation \"org.springframework.boot:spring-boot-starter\"") + !build.contains("implementation \"org.springframework.boot:spring-boot-starter-actuator\"") + build.contains("implementation \"org.springframework.boot:spring-boot-starter-logging\"") + build.contains("implementation \"org.springframework.boot:spring-boot-starter-validation\"") + build.contains("implementation \"org.springframework.boot:spring-boot-autoconfigure\"") + !build.contains("implementation \"org.springframework.boot:spring-boot-starter-tomcat\"") } } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/test/GebSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/test/GebSpec.groovy index b01b877e..1f77346b 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/test/GebSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/test/GebSpec.groovy @@ -17,12 +17,12 @@ class GebSpec extends ApplicationContextSpec implements CommandOutputFixture { final def buildGradle = output["build.gradle"] expect: - buildGradle.contains("testImplementation(\"org.grails.plugins:geb\")") - buildGradle.contains("testImplementation(\"org.seleniumhq.selenium:selenium-api:4.19.1\")") - buildGradle.contains("testImplementation(\"org.seleniumhq.selenium:selenium-support:4.19.1\")") - buildGradle.contains("testImplementation(\"org.seleniumhq.selenium:selenium-remote-driver:4.19.1\")") - buildGradle.contains("testRuntimeOnly(\"org.seleniumhq.selenium:selenium-chrome-driver:4.19.1\")") - buildGradle.contains("testRuntimeOnly(\"org.seleniumhq.selenium:selenium-firefox-driver:4.19.1\")") + buildGradle.contains("testImplementation \"org.grails.plugins:geb\"") + buildGradle.contains("testImplementation \"org.seleniumhq.selenium:selenium-api:4.19.1\"") + buildGradle.contains("testImplementation \"org.seleniumhq.selenium:selenium-support:4.19.1\"") + buildGradle.contains("testImplementation \"org.seleniumhq.selenium:selenium-remote-driver:4.19.1\"") + buildGradle.contains("testRuntimeOnly \"org.seleniumhq.selenium:selenium-chrome-driver:4.19.1\"") + buildGradle.contains("testRuntimeOnly \"org.seleniumhq.selenium:selenium-firefox-driver:4.19.1\"") } void "test GebConfig.groovy file is present"() { @@ -61,11 +61,9 @@ class GebSpec extends ApplicationContextSpec implements CommandOutputFixture { given: final def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11)) final def buildGradle = output["build.gradle"] - final def settingGradle = output["settings.gradle"] expect: - settingGradle.contains("id \"com.github.erdi.webdriver-binaries\" version \"3.2\"") - buildGradle.contains("id \"com.github.erdi.webdriver-binaries\"") + buildGradle.contains("id \"com.github.erdi.webdriver-binaries\" version \"3.2\"") buildGradle.contains("webdriverBinaries") buildGradle.contains("chromedriver '122.0.6260.0'") buildGradle.contains("geckodriver '0.33.0'") @@ -76,11 +74,9 @@ class GebSpec extends ApplicationContextSpec implements CommandOutputFixture { given: final def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11, OperatingSystem.WINDOWS)) final def buildGradle = output["build.gradle"] - final def settingGradle = output["settings.gradle"] expect: - settingGradle.contains("id \"com.github.erdi.webdriver-binaries\" version \"3.2\"") - buildGradle.contains("id \"com.github.erdi.webdriver-binaries\"") + buildGradle.contains("id \"com.github.erdi.webdriver-binaries\" version \"3.2\"") buildGradle.contains("webdriverBinaries") buildGradle.contains("chromedriver '122.0.6260.0'") buildGradle.contains("geckodriver '0.33.0'") diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/test/JUnitSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/test/JUnitSpec.groovy index f610876d..d2bbc31d 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/test/JUnitSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/test/JUnitSpec.groovy @@ -15,6 +15,6 @@ class JUnitSpec extends ApplicationContextSpec implements CommandOutputFixture { final String buildGradle = output["build.gradle"] then: - buildGradle.contains("testImplementation(\"org.junit.jupiter:junit-jupiter") + buildGradle.contains("testImplementation \"org.junit.jupiter:junit-jupiter") } } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/test/SpockSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/test/SpockSpec.groovy index 358b02c7..41c84028 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/test/SpockSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/test/SpockSpec.groovy @@ -13,7 +13,7 @@ class SpockSpec extends ApplicationContextSpec implements CommandOutputFixture { final String buildGradle = output["build.gradle"] then: - buildGradle.contains("testImplementation(\"org.spockframework:spock-core\")") + buildGradle.contains("testImplementation \"org.spockframework:spock-core\"") buildGradle.contains("useJUnitPlatform()") } } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/GrailsGspSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/GrailsGspSpec.groovy index 1f49790e..4972fe71 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/GrailsGspSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/GrailsGspSpec.groovy @@ -30,9 +30,9 @@ class GrailsGspSpec extends ApplicationContextSpec implements CommandOutputFixtu .render() then: - template.contains("id \"org.grails.grails-web\"") + template.contains("apply plugin: \"org.grails.grails-web\"") template.contains("id \"org.grails.grails-gsp\"") - template.contains("implementation(\"org.grails.plugins:gsp\")") + template.contains("implementation \"org.grails.plugins:gsp\"") } void "test gsp configuration"() { @@ -87,9 +87,9 @@ class GrailsGspSpec extends ApplicationContextSpec implements CommandOutputFixtu final String build = output['build.gradle'] then: - build.contains('id "org.grails.grails-web"') - build.contains('id "org.grails.grails-gsp"') - build.contains("implementation(\"org.grails.plugins:gsp\")") + build.contains('apply plugin: "org.grails.grails-web"') + build.contains('apply plugin: "org.grails.grails-gsp"') + build.contains("implementation \"org.grails.plugins:gsp\"") where: applicationType << [ApplicationType.WEB, ApplicationType.WEB_PLUGIN] @@ -103,7 +103,7 @@ class GrailsGspSpec extends ApplicationContextSpec implements CommandOutputFixtu then: !build.contains('id "org.grails.grails-gsp"') - !build.contains("implementation(\"org.grails.plugins:gsp\")") + !build.contains("implementation \"org.grails.plugins:gsp\"") where: applicationType << [ApplicationType.PLUGIN, ApplicationType.REST_API] diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/ScaffoldingSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/ScaffoldingSpec.groovy index 8dd3b201..0edecfa2 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/ScaffoldingSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/ScaffoldingSpec.groovy @@ -22,8 +22,8 @@ class ScaffoldingSpec extends ApplicationContextSpec implements CommandOutputFix .render() then: - template.contains('implementation("org.grails.plugins:scaffolding")') - template.contains('runtimeOnly("org.fusesource.jansi:jansi:1.18")') + template.contains('implementation "org.grails.plugins:scaffolding"') + template.contains('runtimeOnly "org.fusesource.jansi:jansi:1.18"') } } diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/json/ViewJsonSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/json/ViewJsonSpec.groovy index 52ec73ec..d0a11588 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/json/ViewJsonSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/json/ViewJsonSpec.groovy @@ -29,11 +29,11 @@ class ViewJsonSpec extends ApplicationContextSpec implements CommandOutputFixtur .render() then: - template.contains("id \"org.grails.grails-web\"") + template.contains("apply plugin: \"org.grails.grails-web\"") template.contains("id \"org.grails.plugins.views-json\"") - template.contains("implementation(\"org.grails.plugins:views-json\"") - template.contains("implementation(\"org.grails.plugins:views-json-templates\"") - template.contains("testImplementation(\"org.grails:views-json-testing-support\"") + template.contains("implementation \"org.grails.plugins:views-json\"") + template.contains("implementation \"org.grails.plugins:views-json-templates\"") + template.contains("testImplementation \"org.grails:views-json-testing-support\"") } void "test default gson views are present"() { @@ -55,11 +55,11 @@ class ViewJsonSpec extends ApplicationContextSpec implements CommandOutputFixtur final String build = output['build.gradle'] then: - build.contains("id \"org.grails.grails-web\"") + build.contains("apply plugin: \"org.grails.grails-web\"") build.contains("id \"org.grails.plugins.views-json\"") - build.contains("implementation(\"org.grails.plugins:views-json\"") - build.contains("implementation(\"org.grails.plugins:views-json-templates\"") - build.contains("testImplementation(\"org.grails:views-json-testing-support\"") + build.contains("implementation \"org.grails.plugins:views-json\"") + build.contains("implementation \"org.grails.plugins:views-json-templates\"") + build.contains("testImplementation \"org.grails:views-json-testing-support\"") where: applicationType << [ApplicationType.REST_API] @@ -73,9 +73,9 @@ class ViewJsonSpec extends ApplicationContextSpec implements CommandOutputFixtur then: !build.contains("id \"org.grails.plugins.views-json\"") - !build.contains("implementation(\"org.grails.plugins:views-json\"") - !build.contains("implementation(\"org.grails.plugins:views-json-templates\"") - !build.contains("testImplementation(\"org.grails:views-json-testing-support\"") + !build.contains("implementation \"org.grails.plugins:views-json\"") + !build.contains("implementation \"org.grails.plugins:views-json-templates\"") + !build.contains("testImplementation \"org.grails:views-json-testing-support\"") where: applicationType << [ApplicationType.WEB, ApplicationType.WEB_PLUGIN, ApplicationType.PLUGIN] diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/json/ViewMarkupSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/json/ViewMarkupSpec.groovy index 4f7d9e1c..85c3efcd 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/json/ViewMarkupSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/view/json/ViewMarkupSpec.groovy @@ -27,9 +27,9 @@ class ViewMarkupSpec extends ApplicationContextSpec implements CommandOutputFixt .render() then: - template.contains("id \"org.grails.grails-web\"") + template.contains("apply plugin: \"org.grails.grails-web\"") template.contains("id \"org.grails.plugins.views-markup\"") - template.contains("implementation(\"org.grails.plugins:views-markup\"") + template.contains("implementation \"org.grails.plugins:views-markup\"") !template.contains("id \"org.grails.plugins.views-json\"") } @@ -52,12 +52,12 @@ class ViewMarkupSpec extends ApplicationContextSpec implements CommandOutputFixt final String build = output['build.gradle'] then: - build.contains("id \"org.grails.grails-web\"") + build.contains("apply plugin: \"org.grails.grails-web\"") build.contains("id \"org.grails.plugins.views-markup\"") - build.contains("implementation(\"org.grails.plugins:views-markup\"") + build.contains("implementation \"org.grails.plugins:views-markup\"") !build.contains("id \"org.grails.plugins.views-json\"") - !build.contains("implementation(\"org.grails.plugins:views-json\"") - !build.contains("implementation(\"org.grails:views-json-testing-support\"") + !build.contains("implementation \"org.grails.plugins:views-json\"") + !build.contains("implementation \"org.grails:views-json-testing-support\"") where: applicationType << [ApplicationType.REST_API] diff --git a/grails-forge-core/src/test/groovy/org/grails/forge/feature/web/GrailsWebSpec.groovy b/grails-forge-core/src/test/groovy/org/grails/forge/feature/web/GrailsWebSpec.groovy index b5743afc..07353bb5 100644 --- a/grails-forge-core/src/test/groovy/org/grails/forge/feature/web/GrailsWebSpec.groovy +++ b/grails-forge-core/src/test/groovy/org/grails/forge/feature/web/GrailsWebSpec.groovy @@ -16,7 +16,7 @@ class GrailsWebSpec extends ApplicationContextSpec implements CommandOutputFixtu final def buildGradle = output["build.gradle"] expect: - buildGradle.contains("id \"org.grails.grails-web\"") + buildGradle.contains("apply plugin: \"org.grails.grails-web\"") } void "test grails-web configuration"() { diff --git a/test-core/src/test/groovy/org/grails/forge/features/scaffolding/ScaffoldingSpec.groovy b/test-core/src/test/groovy/org/grails/forge/features/scaffolding/ScaffoldingSpec.groovy index f5c0b1f8..05f794a7 100644 --- a/test-core/src/test/groovy/org/grails/forge/features/scaffolding/ScaffoldingSpec.groovy +++ b/test-core/src/test/groovy/org/grails/forge/features/scaffolding/ScaffoldingSpec.groovy @@ -1,7 +1,5 @@ package org.grails.forge.features.scaffolding -import org.gradle.testkit.runner.BuildResult -import org.grails.forge.options.Language import org.grails.forge.utils.CommandSpec class ScaffoldingSpec extends CommandSpec { @@ -23,10 +21,14 @@ class Bird { final String output = executeGradle("runCommand", "-Pargs=generate-controller example.grails.Bird").getOutput() then: - output.contains('Rendered template Controller.groovy to destination grails-app/controllers/example/grails/BirdController.groovy') - output.contains('Rendered template Service.groovy to destination grails-app/services/example/grails/BirdService.groovy') - output.contains('Rendered template Spec.groovy to destination src/test/groovy/example/grails/BirdControllerSpec.groovy') - output.contains('Rendered template ServiceSpec.groovy to destination src/test/groovy/example/grails/BirdServiceSpec.groovy') + output.contains('Rendered template Controller.groovy to destination grails-app') + output.contains('BirdController.groovy') + output.contains('Rendered template Service.groovy to destination grails-app') + output.contains('BirdService.groovy') + output.contains('Rendered template Spec.groovy to destination src') + output.contains('BirdControllerSpec.groovy') + output.contains('Rendered template ServiceSpec.groovy to destination src') + output.contains('BirdServiceSpec.groovy') new File(dir, "grails-app/controllers/example/grails/BirdController.groovy").exists() new File(dir, "grails-app/services/example/grails/BirdService.groovy").exists() new File(dir, "src/test/groovy/example/grails/BirdControllerSpec.groovy").exists()