diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle
index 81ae8af096..9c3d26ba57 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle
@@ -1,5 +1,3 @@
-import org.gradle.api.JavaVersion
-
buildscript {
repositories {
mavenCentral()
@@ -158,7 +156,3 @@ task resolveDependencies {
}
}
}
-
-task wrapper(type: Wrapper) {
- gradleVersion = '4.10.2'
-}
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle/wrapper/gradle-wrapper.jar b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle/wrapper/gradle-wrapper.jar
index 1948b9074f..87b738cbd0 100644
Binary files a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle/wrapper/gradle-wrapper.jar and b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle/wrapper/gradle-wrapper.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle/wrapper/gradle-wrapper.properties
index e0b3fb8d70..b0acbdcd73 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle/wrapper/gradle-wrapper.properties
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradlew b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradlew
index cccdd3d517..af6708ff22 100755
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradlew
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradlew
@@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+DEFAULT_JVM_OPTS='"-Xmx64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradlew.bat b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradlew.bat
index e95643d6a2..0f8d5937c4 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradlew.bat
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradlew.bat
@@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
+set DEFAULT_JVM_OPTS="-Xmx64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/groovy/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.groovy b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/groovy/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.groovy
index 4464a0881b..8896628113 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/groovy/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.groovy
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/groovy/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.groovy
@@ -24,9 +24,6 @@ import org.gradle.api.plugins.GroovyPlugin
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
import org.gradle.jvm.tasks.Jar
-
-import org.springframework.cloud.contract.verifier.config.ContractVerifierConfigProperties
-
/**
* Gradle plugin for Spring Cloud Contract Verifier that from the DSL contract can
*
@@ -150,12 +147,11 @@ class SpringCloudContractVerifierGradlePlugin implements Plugin {
return task
}
else {
- ContractVerifierConfigProperties props = ExtensionToProperties.fromExtension(extension)
task = project.tasks.create(type: Jar, name: VERIFIER_STUBS_JAR_TASK_NAME,
dependsOn: DSL_TO_CLIENT_TASK_NAME) {
baseName = project.name
- classifier = props.stubsSuffix
- from { props.stubsOutputDir ?: project.file("${project.buildDir}/stubs") }
+ classifier = extension.stubsSuffix
+ from { extension.stubsOutputDir ?: project.file("${project.buildDir}/stubs") }
}
task.description = "Creates the stubs JAR task"
task.group = GROUP_NAME
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/build.gradle
index 48c1c5a45e..19b3a0412e 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/build.gradle
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/build.gradle
@@ -59,10 +59,6 @@ contracts {
generateContractTests.dependsOn generateClientStubs
-wrapper {
- gradleVersion '4.10.2'
-}
-
test {
testLogging {
exceptionFormat = 'full'
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties
index 529753a8b2..9304ce536b 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-wiremockVersion=2.20.0
+wiremockVersion=2.23.2
jsonAssertVersion=0.4.13
verifierVersion=2.2.0.BUILD-SNAPSHOT
-groovyVersion=2.4.15
+groovyVersion=2.4.17
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle/wrapper/gradle-wrapper.jar b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle/wrapper/gradle-wrapper.jar
index 1948b9074f..87b738cbd0 100644
Binary files a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle/wrapper/gradle-wrapper.jar and b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle/wrapper/gradle-wrapper.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle/wrapper/gradle-wrapper.properties
index e0b3fb8d70..b0acbdcd73 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle/wrapper/gradle-wrapper.properties
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradlew b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradlew
index cccdd3d517..af6708ff22 100755
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradlew
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradlew
@@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+DEFAULT_JVM_OPTS='"-Xmx64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradlew.bat b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradlew.bat
index e95643d6a2..0f8d5937c4 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradlew.bat
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradlew.bat
@@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
+set DEFAULT_JVM_OPTS="-Xmx64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/build.gradle
index 67fd616ee6..ae57b5ca31 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/build.gradle
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/build.gradle
@@ -123,6 +123,12 @@ configure(project(':fraudDetectionService')) {
stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
}
+ tasks.create(type: Jar, name: 'verifierStubsJar', dependsOn: 'generateClientStubs') {
+ baseName = project.name
+ classifier = contracts.stubsSuffix
+ from ext.stubsOutputDir
+ }
+
contracts {
contractsMode = "REMOTE"
testFramework = 'Spock'
@@ -152,7 +158,3 @@ configure(project(':loanApplicationService')) {
test.dependsOn('copyCollaboratorStubs')
}
-
-wrapper {
- gradleVersion '4.10.2'
-}
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/fraudDetectionService/out/production/resources/application.yml b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/fraudDetectionService/out/production/resources/application.yml
deleted file mode 100644
index cbe617ef03..0000000000
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/fraudDetectionService/out/production/resources/application.yml
+++ /dev/null
@@ -1 +0,0 @@
-server.port=0
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle.properties
index e6d9e15e15..8383d211cc 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle.properties
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle.properties
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-wiremockVersion=2.20.0
+wiremockVersion=2.23.2
jsonAssertVersion=0.4.13
verifierVersion=2.2.0.BUILD-SNAPSHOT
bootVersion=2.2.0.BUILD-SNAPSHOT
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle/wrapper/gradle-wrapper.jar b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle/wrapper/gradle-wrapper.jar
index 1948b9074f..87b738cbd0 100644
Binary files a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle/wrapper/gradle-wrapper.jar and b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle/wrapper/gradle-wrapper.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle/wrapper/gradle-wrapper.properties
index e0b3fb8d70..b0acbdcd73 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle/wrapper/gradle-wrapper.properties
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradlew b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradlew
index cccdd3d517..af6708ff22 100755
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradlew
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradlew
@@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+DEFAULT_JVM_OPTS='"-Xmx64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradlew.bat b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradlew.bat
index e95643d6a2..0f8d5937c4 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradlew.bat
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradlew.bat
@@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
+set DEFAULT_JVM_OPTS="-Xmx64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/build.gradle
index 7f9ab29ddb..d3ec3ce217 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/build.gradle
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/build.gradle
@@ -130,7 +130,3 @@ configure(project(':loanApplicationService')) {
generateContractTests.dependsOn('copyCollaboratorStubs')
}
-
-wrapper {
- gradleVersion '4.10.2'
-}
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle.properties
index e6d9e15e15..8383d211cc 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle.properties
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle.properties
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-wiremockVersion=2.20.0
+wiremockVersion=2.23.2
jsonAssertVersion=0.4.13
verifierVersion=2.2.0.BUILD-SNAPSHOT
bootVersion=2.2.0.BUILD-SNAPSHOT
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle/wrapper/gradle-wrapper.jar b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle/wrapper/gradle-wrapper.jar
index 1948b9074f..87b738cbd0 100644
Binary files a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle/wrapper/gradle-wrapper.jar and b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle/wrapper/gradle-wrapper.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle/wrapper/gradle-wrapper.properties
index e0b3fb8d70..b0acbdcd73 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle/wrapper/gradle-wrapper.properties
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradlew b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradlew
index cccdd3d517..af6708ff22 100755
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradlew
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradlew
@@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+DEFAULT_JVM_OPTS='"-Xmx64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradlew.bat b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradlew.bat
index e95643d6a2..0f8d5937c4 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradlew.bat
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradlew.bat
@@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
+set DEFAULT_JVM_OPTS="-Xmx64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/build.gradle
index a7a301c1c1..0b1c78981f 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/build.gradle
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/build.gradle
@@ -156,7 +156,3 @@ configure(project(':loanApplicationService')) {
generateContractTests.dependsOn('copyCollaboratorStubs')
}
-
-wrapper {
- gradleVersion '4.10.2'
-}
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle.properties
index 20d619d327..5048171bf4 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle.properties
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle.properties
@@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-wiremockVersion=2.20.0
+wiremockVersion=2.23.2
jsonAssertVersion=0.4.13
verifierVersion=2.2.0.BUILD-SNAPSHOT
bootVersion=2.2.0.BUILD-SNAPSHOT
-groovyVersion=2.4.15
+groovyVersion=2.4.17
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle/wrapper/gradle-wrapper.jar b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle/wrapper/gradle-wrapper.jar
index 1948b9074f..87b738cbd0 100644
Binary files a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle/wrapper/gradle-wrapper.jar and b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle/wrapper/gradle-wrapper.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle/wrapper/gradle-wrapper.properties
index e0b3fb8d70..b0acbdcd73 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle/wrapper/gradle-wrapper.properties
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradlew b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradlew
index cccdd3d517..af6708ff22 100755
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradlew
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradlew
@@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+DEFAULT_JVM_OPTS='"-Xmx64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradlew.bat b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradlew.bat
index e95643d6a2..0f8d5937c4 100644
--- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradlew.bat
+++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradlew.bat
@@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
+set DEFAULT_JVM_OPTS="-Xmx64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/builder/MockMvcQueryParamsWhen.java b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/builder/MockMvcQueryParamsWhen.java
index c22d1451c6..6da2976e43 100644
--- a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/builder/MockMvcQueryParamsWhen.java
+++ b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/builder/MockMvcQueryParamsWhen.java
@@ -58,8 +58,8 @@ class MockMvcQueryParamsWhen implements When, MockMvcAcceptor, QueryParamsResolv
}
private void addQueryParameters(Url buildUrl) {
- List queryParameters = buildUrl.getQueryParameters().getParameters().stream()
- .filter(this::allowedQueryParameter)
+ List queryParameters = buildUrl.getQueryParameters()
+ .getParameters().stream().filter(this::allowedQueryParameter)
.collect(Collectors.toList());
Iterator iterator = queryParameters.iterator();
while (iterator.hasNext()) {
@@ -67,7 +67,8 @@ class MockMvcQueryParamsWhen implements When, MockMvcAcceptor, QueryParamsResolv
String text = addQueryParameter(parameter);
if (iterator.hasNext()) {
this.blockBuilder.addLine(text);
- } else {
+ }
+ else {
this.blockBuilder.addIndented(text);
}
}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/ContractVerifierConfigProperties.groovy b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/ContractVerifierConfigProperties.groovy
deleted file mode 100644
index 47063625bf..0000000000
--- a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/ContractVerifierConfigProperties.groovy
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.contract.verifier.config
-
-import org.apache.commons.logging.Log
-import org.apache.commons.logging.LogFactory
-
-/**
- * Represents Contract Verifier configuration properties
- *
- * @author Jakub Kubrynski, codearte.io
- *
- * @since 1.0.0
- */
-class ContractVerifierConfigProperties {
-
- private static final Log log = LogFactory.getLog(ContractVerifierConfigProperties)
-
- /**
- * For which unit test library tests should be generated
- * @deprecated - use {@code testFramework}
- */
- @Deprecated
- TestFramework targetFramework
-
- @Deprecated
- void setTargetFramework(TestFramework targetFramework) {
- log.warn("Please use the [testFramework] field. [targetFramework] is deprecated")
- setTestFramework(targetFramework)
- }
-
- @Deprecated
- TestFramework getTargetFramework() {
- return getTestFramework()
- }
-
- /**
- * For which unit test library tests should be generated
- */
- TestFramework testFramework = TestFramework.JUNIT
-
- /**
- * Which mechanism should be used to invoke REST calls during tests
- */
- TestMode testMode = TestMode.MOCKMVC
-
- /**
- * Base package for generated tests
- */
- String basePackageForTests
-
- /**
- * Class which all generated tests should extend
- */
- String baseClassForTests
-
- /**
- * Suffix for generated test classes, like Spec or Test
- */
- String nameSuffixForTests
-
- /**
- * Rule class that should be added to generated tests
- */
- String ruleClassForTests
-
- /**
- * Patterns that should not be taken into account for processing
- */
- List excludedFiles = []
-
- /**
- * Patterns that should be taken into account for processing
- */
- List includedFiles = []
-
- /**
- * Patterns for which generated tests should be @Ignored
- */
- List ignoredFiles = []
-
- /**
- * Imports that should be added to generated tests
- */
- String[] imports = []
-
- /**
- * Static imports that should be added to generated tests
- */
- String[] staticImports = []
-
- /**
- * Directory containing contracts
- */
- File contractsDslDir
-
- /**
- * Test source directory where tests generated
- */
- File generatedTestSourcesDir
-
- /**
- * Test resource directory where additional resources for tests will be set
- */
- File generatedTestResourcesDir
-
- /**
- * Dir where the generated stubs from the contracts should be placed.
- * You can then mention them in your packaging task to create jar with stubs
- */
- File stubsOutputDir
-
- /**
- * Suffix for the generated Stubs Jar task
- */
- String stubsSuffix = 'stubs'
-
- /**
- * Incubating feature. You can check the size of JSON arrays. If not turned on
- * explicitly will be disabled.
- */
- Boolean assertJsonSize = false
-
- /**
- * A regular expression that matches contracts. Especially useful when using a single JAR containing
- * all the contracts in the system. In this case you'd like to take into consideration only some of them.
- * Defaults to picking all files.
- */
- String includedContracts = ".*"
-
- /**
- * A ant pattern to match files. Gets updated when using repo with common contracts
- * to reflect the path to proper folder with contracts.
- */
- String includedRootFolderAntPattern = "**/"
-
- /**
- * A package that contains all the base clases for generated tests. If your contract resides in a location
- * {@code src/test/resources/contracts/com/example/v1/} and you provide the {@code packageWithBaseClasses}
- * value to {@code com.example.contracts.base} then we will search for a test source file that will
- * have the package {@code com.example.contracts.base} and name {@code ExampleV1Base}. As you can see
- * it will take the two last folders to and attach {@code Base} to its name.
- */
- String packageWithBaseClasses
-
- /**
- * A way to override any base class mappings. The keys are regular expressions on the package name of the contract
- * and the values FQN to a base class for that given expression.
- *
- * Example of a mapping
- *
- * {@code .*.com.example.v1..*} -> {@code com.example.SomeBaseClass}
- *
- * When a contract's package matches the provided regular expression then extending class will be the one
- * provided in the map - in this case {@code com.example.SomeBaseClass}
- */
- Map baseClassMappings
-
- /**
- * If set to true then the {@code target} or {@code build} folders are getting
- * excluded from any operations. This is used out of the box when working with
- * common repo with contracts.
- */
- boolean excludeBuildFolders
-
-}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/ContractVerifierConfigProperties.java b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/ContractVerifierConfigProperties.java
new file mode 100644
index 0000000000..3693d49a62
--- /dev/null
+++ b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/ContractVerifierConfigProperties.java
@@ -0,0 +1,369 @@
+/*
+ * Copyright 2013-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.cloud.contract.verifier.config;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Represents Contract Verifier configuration properties.
+ *
+ * @author Jakub Kubrynski, codearte.io
+ * @since 1.0.0
+ */
+public class ContractVerifierConfigProperties {
+
+ private static final Log log = LogFactory
+ .getLog(ContractVerifierConfigProperties.class);
+
+ /**
+ * For which unit test library tests should be generated.
+ * @deprecated - use {@code testFramework}
+ */
+ @Deprecated
+ private TestFramework targetFramework;
+
+ /**
+ * For which unit test library tests should be generated.
+ */
+ private TestFramework testFramework = TestFramework.JUNIT;
+
+ /**
+ * Which mechanism should be used to invoke REST calls during. tests
+ */
+ private TestMode testMode = TestMode.MOCKMVC;
+
+ /**
+ * Base package for generated tests.
+ */
+ private String basePackageForTests;
+
+ /**
+ * Class which all generated tests should extend.
+ */
+ private String baseClassForTests;
+
+ /**
+ * Suffix for generated test classes, like Spec or Test.
+ */
+ private String nameSuffixForTests;
+
+ /**
+ * Rule class that should be added to generated tests.
+ */
+ private String ruleClassForTests;
+
+ /**
+ * Patterns that should not be taken into account for processing.
+ */
+ private List excludedFiles = new ArrayList<>();
+
+ /**
+ * Patterns that should be taken into account for processing.
+ */
+ private List includedFiles = new ArrayList();
+
+ /**
+ * Patterns for which generated tests should be @Ignored.
+ */
+ private List ignoredFiles = new ArrayList();
+
+ /**
+ * Imports that should be added to generated tests.
+ */
+ private String[] imports = new String[0];
+
+ /**
+ * Static imports that should be added to generated tests.
+ */
+ private String[] staticImports = new String[0];
+
+ /**
+ * Directory containing contracts.
+ */
+ private File contractsDslDir;
+
+ /**
+ * Test source directory where tests generated.
+ */
+ private File generatedTestSourcesDir;
+
+ /**
+ * Test resource directory where additional resources for tests will be set.
+ */
+ private File generatedTestResourcesDir;
+
+ /**
+ * Dir where the generated stubs from the contracts should be placed. You can then
+ * mention them in your packaging task to create jar with stubs.
+ */
+ private File stubsOutputDir;
+
+ /**
+ * Suffix for the generated Stubs Jar task.
+ */
+ private String stubsSuffix = "stubs";
+
+ /**
+ * Incubating feature. You can check the size of JSON arrays. If not turned on
+ * explicitly will be disabled.
+ */
+ private Boolean assertJsonSize = false;
+
+ /**
+ * A regular expression that matches contracts. Especially useful when using a single
+ * JAR containing all the contracts in the system. In this case you'd like to take
+ * into consideration only some of them. Defaults to picking all files.
+ */
+ private String includedContracts = ".*";
+
+ /**
+ * A ant pattern to match files. Gets updated when using repo with common contracts to
+ * reflect the path to proper folder with contracts.
+ */
+ private String includedRootFolderAntPattern = "**/";
+
+ /**
+ * A package that contains all the base clases for generated tests. If your contract
+ * resides in a location {@code src/test/resources/contracts/com/example/v1/} and you
+ * provide the {@code packageWithBaseClasses} value to
+ * {@code com.example.contracts.base} then we will search for a test source file that
+ * will have the package {@code com.example.contracts.base} and name
+ * {@code ExampleV1Base}. As you can see it will take the two last folders to and
+ * attach {@code Base} to its name.
+ */
+ private String packageWithBaseClasses;
+
+ /**
+ * A way to override any base class mappings. The keys are regular expressions on the
+ * package name of the contract and the values FQN to a base class for that given
+ * expression.
+ *
+ * Example of a mapping
+ *
+ * {@code .*.com.example.v1..*} -> {@code com.example.SomeBaseClass}
+ *
+ * When a contract's package matches the provided regular expression then extending
+ * class will be the one provided in the map - in this case
+ * {@code com.example.SomeBaseClass}
+ */
+ private Map baseClassMappings;
+
+ /**
+ * If set to true then the {@code target} or {@code build} folders are getting
+ * excluded from any operations. This is used out of the box when working with common
+ * repo with contracts.
+ */
+ private boolean excludeBuildFolders;
+
+ @Deprecated
+ public void setTargetFramework(TestFramework targetFramework) {
+ log.warn("Please use the [testFramework] field. [targetFramework] is deprecated");
+ setTestFramework(targetFramework);
+ }
+
+ @Deprecated
+ public TestFramework getTargetFramework() {
+ return getTestFramework();
+ }
+
+ public TestFramework getTestFramework() {
+ return testFramework;
+ }
+
+ public void setTestFramework(TestFramework testFramework) {
+ this.testFramework = testFramework;
+ }
+
+ public TestMode getTestMode() {
+ return testMode;
+ }
+
+ public void setTestMode(TestMode testMode) {
+ this.testMode = testMode;
+ }
+
+ public String getBasePackageForTests() {
+ return basePackageForTests;
+ }
+
+ public void setBasePackageForTests(String basePackageForTests) {
+ this.basePackageForTests = basePackageForTests;
+ }
+
+ public String getBaseClassForTests() {
+ return baseClassForTests;
+ }
+
+ public void setBaseClassForTests(String baseClassForTests) {
+ this.baseClassForTests = baseClassForTests;
+ }
+
+ public String getNameSuffixForTests() {
+ return nameSuffixForTests;
+ }
+
+ public void setNameSuffixForTests(String nameSuffixForTests) {
+ this.nameSuffixForTests = nameSuffixForTests;
+ }
+
+ public String getRuleClassForTests() {
+ return ruleClassForTests;
+ }
+
+ public void setRuleClassForTests(String ruleClassForTests) {
+ this.ruleClassForTests = ruleClassForTests;
+ }
+
+ public List getExcludedFiles() {
+ return excludedFiles;
+ }
+
+ public void setExcludedFiles(List excludedFiles) {
+ this.excludedFiles = excludedFiles;
+ }
+
+ public List getIncludedFiles() {
+ return includedFiles;
+ }
+
+ public void setIncludedFiles(List includedFiles) {
+ this.includedFiles = includedFiles;
+ }
+
+ public List getIgnoredFiles() {
+ return ignoredFiles;
+ }
+
+ public void setIgnoredFiles(List ignoredFiles) {
+ this.ignoredFiles = ignoredFiles;
+ }
+
+ public String[] getImports() {
+ return imports;
+ }
+
+ public void setImports(String[] imports) {
+ this.imports = imports;
+ }
+
+ public String[] getStaticImports() {
+ return staticImports;
+ }
+
+ public void setStaticImports(String[] staticImports) {
+ this.staticImports = staticImports;
+ }
+
+ public File getContractsDslDir() {
+ return contractsDslDir;
+ }
+
+ public void setContractsDslDir(File contractsDslDir) {
+ this.contractsDslDir = contractsDslDir;
+ }
+
+ public File getGeneratedTestSourcesDir() {
+ return generatedTestSourcesDir;
+ }
+
+ public void setGeneratedTestSourcesDir(File generatedTestSourcesDir) {
+ this.generatedTestSourcesDir = generatedTestSourcesDir;
+ }
+
+ public File getGeneratedTestResourcesDir() {
+ return generatedTestResourcesDir;
+ }
+
+ public void setGeneratedTestResourcesDir(File generatedTestResourcesDir) {
+ this.generatedTestResourcesDir = generatedTestResourcesDir;
+ }
+
+ public File getStubsOutputDir() {
+ return stubsOutputDir;
+ }
+
+ public void setStubsOutputDir(File stubsOutputDir) {
+ this.stubsOutputDir = stubsOutputDir;
+ }
+
+ public String getStubsSuffix() {
+ return stubsSuffix;
+ }
+
+ public void setStubsSuffix(String stubsSuffix) {
+ this.stubsSuffix = stubsSuffix;
+ }
+
+ public Boolean getAssertJsonSize() {
+ return assertJsonSize;
+ }
+
+ public void setAssertJsonSize(Boolean assertJsonSize) {
+ this.assertJsonSize = assertJsonSize;
+ }
+
+ public String getIncludedContracts() {
+ return includedContracts;
+ }
+
+ public void setIncludedContracts(String includedContracts) {
+ this.includedContracts = includedContracts;
+ }
+
+ public String getIncludedRootFolderAntPattern() {
+ return includedRootFolderAntPattern;
+ }
+
+ public void setIncludedRootFolderAntPattern(String includedRootFolderAntPattern) {
+ this.includedRootFolderAntPattern = includedRootFolderAntPattern;
+ }
+
+ public String getPackageWithBaseClasses() {
+ return packageWithBaseClasses;
+ }
+
+ public void setPackageWithBaseClasses(String packageWithBaseClasses) {
+ this.packageWithBaseClasses = packageWithBaseClasses;
+ }
+
+ public Map getBaseClassMappings() {
+ return baseClassMappings;
+ }
+
+ public void setBaseClassMappings(Map baseClassMappings) {
+ this.baseClassMappings = baseClassMappings;
+ }
+
+ public boolean getExcludeBuildFolders() {
+ return excludeBuildFolders;
+ }
+
+ public boolean isExcludeBuildFolders() {
+ return excludeBuildFolders;
+ }
+
+ public void setExcludeBuildFolders(boolean excludeBuildFolders) {
+ this.excludeBuildFolders = excludeBuildFolders;
+ }
+
+}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/TestFramework.groovy b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/TestFramework.groovy
deleted file mode 100644
index 488e088c84..0000000000
--- a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/TestFramework.groovy
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.contract.verifier.config
-
-import groovy.transform.CompileStatic
-
-import org.springframework.cloud.contract.verifier.config.framework.CustomDefinition
-import org.springframework.cloud.contract.verifier.config.framework.JUnit5Definition
-import org.springframework.cloud.contract.verifier.config.framework.JUnitDefinition
-import org.springframework.cloud.contract.verifier.config.framework.SpockDefinition
-import org.springframework.cloud.contract.verifier.config.framework.TestFrameworkDefinition
-
-/**
- * Contains main building blocks for a test class for the given framework
- *
- * @author Jakub Kubrynski, codearte.io
- * @author Olga Maciaszek-Sharma
- *
- * @since 1.0.0
- */
-@CompileStatic
-enum TestFramework {
-
- SPOCK(new SpockDefinition()),
- JUNIT(new JUnitDefinition()),
- JUNIT5(new JUnit5Definition()),
- CUSTOM(new CustomDefinition())
-
- private final TestFrameworkDefinition testFrameworkDefinition
-
-
- TestFramework(TestFrameworkDefinition testFrameworkDefinition) {
- this.testFrameworkDefinition = testFrameworkDefinition
- }
-
- /**
- * @deprecated use{@link #TestFramework(TestFrameworkDefinition)}
- * @param classModifier
- * @param methodModifier
- * @param lineSuffix
- * @param classExtension
- * @param classNameSuffix
- * @param ignoreClass
- * @param orderAnnotationImports
- * @param orderAnnotation
- */
- @Deprecated
- TestFramework(String classModifier, String methodModifier, String lineSuffix, String classExtension, String classNameSuffix,
- String ignoreClass, List orderAnnotationImports, String orderAnnotation) {
- testFrameworkDefinition = new TestFrameworkDefinition() {
-
- @Override
- String getClassModifier() {
- return classModifier
- }
-
- @Override
- String getMethodModifier() {
- return methodModifier
- }
-
- @Override
- String getLineSuffix() {
- return lineSuffix
- }
-
- @Override
- String getClassExtension() {
- return classExtension
- }
-
- @Override
- String getClassNameSuffix() {
- return classNameSuffix
- }
-
- @Override
- String getIgnoreClass() {
- return ignoreClass
- }
-
- @Override
- List getOrderAnnotationImports() {
- return orderAnnotationImports
- }
-
- @Override
- String getOrderAnnotation() {
- return orderAnnotation
- }
-
- @Override
- String getIgnoreAnnotation() {
- return '@Ignore'
- }
-
- @Override
- boolean annotationLevelRules() {
- return false
- }
-
- @Override
- String getRuleAnnotation(String annotationValue) {
- throw new UnsupportedOperationException('Not available in framework.')
- }
- }
- }
-
- String getClassModifier() {
- return this.testFrameworkDefinition.classModifier
- }
-
- String getMethodModifier() {
- return this.testFrameworkDefinition.methodModifier
- }
-
- String getLineSuffix() {
- return this.testFrameworkDefinition.lineSuffix
- }
-
- String getClassExtension() {
- return this.testFrameworkDefinition.classExtension
- }
-
- String getClassNameSuffix() {
- return this.testFrameworkDefinition.classNameSuffix
- }
-
- String getIgnoreClass() {
- return this.testFrameworkDefinition.ignoreClass
- }
-
- List getOrderAnnotationImports() {
- return this.testFrameworkDefinition.orderAnnotationImports
- }
-
- String getOrderAnnotation() {
- return this.testFrameworkDefinition.orderAnnotation
- }
-
- String getIgnoreAnnotation() {
- return this.testFrameworkDefinition.ignoreAnnotation
- }
-
- boolean annotationLevelRules() {
- return this.testFrameworkDefinition.annotationLevelRules()
- }
-
- String getRuleAnnotation(String annotationValue) {
- return this.testFrameworkDefinition.getRuleAnnotation(annotationValue)
- }
-}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/TestFramework.java b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/TestFramework.java
new file mode 100644
index 0000000000..ae7e0f6aaf
--- /dev/null
+++ b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/TestFramework.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2013-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.cloud.contract.verifier.config;
+
+import java.util.List;
+
+import org.springframework.cloud.contract.verifier.config.framework.CustomDefinition;
+import org.springframework.cloud.contract.verifier.config.framework.JUnit5Definition;
+import org.springframework.cloud.contract.verifier.config.framework.JUnitDefinition;
+import org.springframework.cloud.contract.verifier.config.framework.SpockDefinition;
+import org.springframework.cloud.contract.verifier.config.framework.TestFrameworkDefinition;
+
+/**
+ * Contains main building blocks for a test class for the given framework.
+ *
+ * @author Jakub Kubrynski, codearte.io
+ * @author Olga Maciaszek-Sharma
+ *
+ * @since 1.0.0
+ */
+public enum TestFramework {
+
+ /**
+ * Spock test framework.
+ */
+ SPOCK(new SpockDefinition()),
+ /**
+ * JUnit test framework.
+ */
+ JUNIT(new JUnitDefinition()),
+ /**
+ * JUnit5 test framework.
+ */
+ JUNIT5(new JUnit5Definition()),
+ /**
+ * Custom test framework.
+ */
+ CUSTOM(new CustomDefinition());
+
+ private final TestFrameworkDefinition testFrameworkDefinition;
+
+ TestFramework(TestFrameworkDefinition testFrameworkDefinition) {
+ this.testFrameworkDefinition = testFrameworkDefinition;
+ }
+
+ /**
+ * @deprecated use{@link #TestFramework(TestFrameworkDefinition)}
+ * @param classModifier class modifier
+ * @param methodModifier method modifier
+ * @param lineSuffix line suffix
+ * @param classExtension class extension
+ * @param classNameSuffix class name suffix
+ * @param ignoreClass ignore class
+ * @param orderAnnotationImports order annotation imports
+ * @param orderAnnotation order annotation
+ */
+ @Deprecated
+ TestFramework(final String classModifier, final String methodModifier,
+ final String lineSuffix, final String classExtension,
+ final String classNameSuffix, final String ignoreClass,
+ final List orderAnnotationImports, final String orderAnnotation) {
+ testFrameworkDefinition = new TestFrameworkDefinition() {
+ @Override
+ public String getClassModifier() {
+ return classModifier;
+ }
+
+ @Override
+ public String getMethodModifier() {
+ return methodModifier;
+ }
+
+ @Override
+ public String getLineSuffix() {
+ return lineSuffix;
+ }
+
+ @Override
+ public String getClassExtension() {
+ return classExtension;
+ }
+
+ @Override
+ public String getClassNameSuffix() {
+ return classNameSuffix;
+ }
+
+ @Override
+ public String getIgnoreClass() {
+ return ignoreClass;
+ }
+
+ @Override
+ public List getOrderAnnotationImports() {
+ return orderAnnotationImports;
+ }
+
+ @Override
+ public String getOrderAnnotation() {
+ return orderAnnotation;
+ }
+
+ @Override
+ public String getIgnoreAnnotation() {
+ return "@Ignore";
+ }
+
+ @Override
+ public boolean annotationLevelRules() {
+ return false;
+ }
+
+ @Override
+ public String getRuleAnnotation(String annotationValue) {
+ throw new UnsupportedOperationException("Not available in framework.");
+ }
+
+ };
+ }
+
+ public String getClassModifier() {
+ return this.testFrameworkDefinition.getClassModifier();
+ }
+
+ public String getMethodModifier() {
+ return this.testFrameworkDefinition.getMethodModifier();
+ }
+
+ public String getLineSuffix() {
+ return this.testFrameworkDefinition.getLineSuffix();
+ }
+
+ public String getClassExtension() {
+ return this.testFrameworkDefinition.getClassExtension();
+ }
+
+ public String getClassNameSuffix() {
+ return this.testFrameworkDefinition.getClassNameSuffix();
+ }
+
+ public String getIgnoreClass() {
+ return this.testFrameworkDefinition.getIgnoreClass();
+ }
+
+ public List getOrderAnnotationImports() {
+ return this.testFrameworkDefinition.getOrderAnnotationImports();
+ }
+
+ public String getOrderAnnotation() {
+ return this.testFrameworkDefinition.getOrderAnnotation();
+ }
+
+ public String getIgnoreAnnotation() {
+ return this.testFrameworkDefinition.getIgnoreAnnotation();
+ }
+
+ public boolean annotationLevelRules() {
+ return this.testFrameworkDefinition.annotationLevelRules();
+ }
+
+ public String getRuleAnnotation(String annotationValue) {
+ return this.testFrameworkDefinition.getRuleAnnotation(annotationValue);
+ }
+
+}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/TestMode.groovy b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/TestMode.java
similarity index 72%
rename from spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/TestMode.groovy
rename to spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/TestMode.java
index dffc47c93d..d9c7a34130 100644
--- a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/TestMode.groovy
+++ b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/TestMode.java
@@ -14,33 +14,32 @@
* limitations under the License.
*/
-package org.springframework.cloud.contract.verifier.config
+package org.springframework.cloud.contract.verifier.config;
/**
- * Provides different testing modes
+ * Provides different testing modes.
*
* @author Jakub Kubrynski, codearte.io
*
* @since 1.0.0
*/
-enum TestMode {
+public enum TestMode {
+
/**
- * Uses Spring's MockMvc with Rest Assured 2.x
+ * Uses Spring's MockMvc mode.
*/
MOCKMVC,
-
/**
- * Uses direct HTTP invocations with Rest Assured 2.x
+ * Uses direct HTTP invocations with Rest Assured.
*/
EXPLICIT,
-
/**
- * Uses JAX-RS client
+ * Uses JAX-RS client.
*/
JAXRSCLIENT,
-
/**
- * Uses Spring's reactive WebTestClient
+ * Uses Spring's reactive WebTestClient.
*/
- WEBTESTCLIENT
+ WEBTESTCLIENT;
+
}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/CustomDefinition.groovy b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/CustomDefinition.java
similarity index 53%
rename from spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/CustomDefinition.groovy
rename to spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/CustomDefinition.java
index 0181c25ec5..67c28a9088 100644
--- a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/CustomDefinition.groovy
+++ b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/CustomDefinition.java
@@ -14,72 +14,73 @@
* limitations under the License.
*/
-package org.springframework.cloud.contract.verifier.config.framework
+package org.springframework.cloud.contract.verifier.config.framework;
-import groovy.transform.CompileStatic
+import java.util.ArrayList;
+import java.util.List;
/**
- * Defines elements characteristic of Custom test framework to be used during test class construction.
+ * Defines elements characteristic of Custom test framework to be used during test class
+ * construction.
*
* @author Olga Maciaszek-Sharma
- *
* @since 2.1.0
*/
-@CompileStatic
-class CustomDefinition implements TestFrameworkDefinition {
+public class CustomDefinition implements TestFrameworkDefinition {
@Override
- String getClassModifier() {
- return ''
+ public String getClassModifier() {
+ return "";
}
@Override
- String getMethodModifier() {
- return ''
+ public String getMethodModifier() {
+ return "";
}
@Override
- String getLineSuffix() {
- return ''
+ public String getLineSuffix() {
+ return "";
}
@Override
- String getClassExtension() {
- return ''
+ public String getClassExtension() {
+ return "";
}
@Override
- String getClassNameSuffix() {
- return ''
+ public String getClassNameSuffix() {
+ return "";
}
@Override
- String getIgnoreClass() {
- return ''
+ public String getIgnoreClass() {
+ return "";
}
@Override
- List getOrderAnnotationImports() {
- return []
+ public List getOrderAnnotationImports() {
+ return new ArrayList();
}
@Override
- String getOrderAnnotation() {
- return ''
+ public String getOrderAnnotation() {
+ return "";
}
@Override
- String getIgnoreAnnotation() {
- return '@Ignore'
+ public String getIgnoreAnnotation() {
+ return "@Ignore";
}
@Override
- boolean annotationLevelRules() {
- return false
+ public boolean annotationLevelRules() {
+ return false;
}
@Override
- String getRuleAnnotation(String annotationValue) {
- throw new UnsupportedOperationException('Not available in framework.')
+ public String getRuleAnnotation(String annotationValue) {
+ throw new UnsupportedOperationException("Not available in framework.");
}
+
}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/JUnit5Definition.groovy b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/JUnit5Definition.groovy
deleted file mode 100644
index c8917eccbd..0000000000
--- a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/JUnit5Definition.groovy
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.contract.verifier.config.framework
-
-import groovy.transform.CompileStatic
-
-/**
- * Defines elements characteristic of JUnit5 test framework to be used during test class construction.
- *
- * @author Olga Maciaszek-Sharma
- *
- * @since 2.1.0
- */
-@CompileStatic
-class JUnit5Definition implements TestFrameworkDefinition {
-
- @Override
- String getClassModifier() {
- return 'public '
- }
-
- @Override
- String getMethodModifier() {
- return 'public void '
- }
-
- @Override
- String getLineSuffix() {
- return ';'
- }
-
- @Override
- String getClassExtension() {
- '.java'
- }
-
- @Override
- String getClassNameSuffix() {
- return 'Test'
- }
-
- @Override
- String getIgnoreClass() {
- return 'org.junit.jupiter.api.Disabled'
- }
-
- @Override
- List getOrderAnnotationImports() {
- throw new UnsupportedOperationException('Not implemented yet in JUnit5 - https://github.com/junit-team/junit5/issues/48')
- }
-
- @Override
- String getOrderAnnotation() {
- throw new UnsupportedOperationException('Not implemented yet in JUnit5 - https://github.com/junit-team/junit5/issues/48')
- }
-
- @Override
- String getIgnoreAnnotation() {
- return '@Disabled'
- }
-
- @Override
- boolean annotationLevelRules() {
- return true
- }
-
- @Override
- String getRuleAnnotation(String annotationValue) {
- return ("@ExtendWith(${annotationValue}.class)")
- }
-}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/JUnit5Definition.java b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/JUnit5Definition.java
new file mode 100644
index 0000000000..61fb8bdc48
--- /dev/null
+++ b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/JUnit5Definition.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2013-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.cloud.contract.verifier.config.framework;
+
+import java.util.List;
+
+/**
+ * Defines elements characteristic of JUnit5 test framework to be used during test class
+ * construction.
+ *
+ * @author Olga Maciaszek-Sharma
+ * @since 2.1.0
+ */
+public class JUnit5Definition implements TestFrameworkDefinition {
+
+ @Override
+ public String getClassModifier() {
+ return "public ";
+ }
+
+ @Override
+ public String getMethodModifier() {
+ return "public void ";
+ }
+
+ @Override
+ public String getLineSuffix() {
+ return ";";
+ }
+
+ @Override
+ public String getClassExtension() {
+ return ".java";
+ }
+
+ @Override
+ public String getClassNameSuffix() {
+ return "Test";
+ }
+
+ @Override
+ public String getIgnoreClass() {
+ return "org.junit.jupiter.api.Disabled";
+ }
+
+ @Override
+ public List getOrderAnnotationImports() {
+ throw new UnsupportedOperationException(
+ "Not implemented yet in JUnit5 - https://github.com/junit-team/junit5/issues/48");
+ }
+
+ @Override
+ public String getOrderAnnotation() {
+ throw new UnsupportedOperationException(
+ "Not implemented yet in JUnit5 - https://github.com/junit-team/junit5/issues/48");
+ }
+
+ @Override
+ public String getIgnoreAnnotation() {
+ return "@Disabled";
+ }
+
+ @Override
+ public boolean annotationLevelRules() {
+ return true;
+ }
+
+ @Override
+ public String getRuleAnnotation(final String annotationValue) {
+ return ("@ExtendWith(" + annotationValue + ".class)");
+ }
+
+}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/JUnitDefinition.groovy b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/JUnitDefinition.groovy
deleted file mode 100644
index 6a58714adf..0000000000
--- a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/JUnitDefinition.groovy
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.contract.verifier.config.framework
-
-import groovy.transform.CompileStatic
-
-/**
- * Defines elements characteristic of JUnit test framework to be used during test class construction.
- *
- * @author Olga Maciaszek-Sharma
- *
- * @since 2.1.0
- */
-@CompileStatic
-class JUnitDefinition implements TestFrameworkDefinition {
-
- @Override
- String getClassModifier() {
- return 'public '
- }
-
- @Override
- String getMethodModifier() {
- return 'public void '
- }
-
- @Override
- String getLineSuffix() {
- return ';'
- }
-
- @Override
- String getClassExtension() {
- return '.java'
- }
-
- @Override
- String getClassNameSuffix() {
- return 'Test'
- }
-
- @Override
- String getIgnoreClass() {
- return 'org.junit.Ignore'
- }
-
- @Override
- List getOrderAnnotationImports() {
- return ['org.junit.FixMethodOrder', 'org.junit.runners.MethodSorters']
- }
-
- @Override
- String getOrderAnnotation() {
- return '@FixMethodOrder(MethodSorters.NAME_ASCENDING)'
- }
-
- @Override
- String getIgnoreAnnotation() {
- return '@Ignore'
- }
-
- @Override
- boolean annotationLevelRules() {
- return false
- }
-
- @Override
- String getRuleAnnotation(String annotationValue) {
- throw new UnsupportedOperationException('Not available in JUnit.')
- }
-}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/JUnitDefinition.java b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/JUnitDefinition.java
new file mode 100644
index 0000000000..6c8756d6a0
--- /dev/null
+++ b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/JUnitDefinition.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2013-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.cloud.contract.verifier.config.framework;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Defines elements characteristic of JUnit test framework to be used during test class
+ * construction.
+ *
+ * @author Olga Maciaszek-Sharma
+ * @since 2.1.0
+ */
+public class JUnitDefinition implements TestFrameworkDefinition {
+
+ @Override
+ public String getClassModifier() {
+ return "public ";
+ }
+
+ @Override
+ public String getMethodModifier() {
+ return "public void ";
+ }
+
+ @Override
+ public String getLineSuffix() {
+ return ";";
+ }
+
+ @Override
+ public String getClassExtension() {
+ return ".java";
+ }
+
+ @Override
+ public String getClassNameSuffix() {
+ return "Test";
+ }
+
+ @Override
+ public String getIgnoreClass() {
+ return "org.junit.Ignore";
+ }
+
+ @Override
+ public List getOrderAnnotationImports() {
+ return new ArrayList(Arrays.asList("org.junit.FixMethodOrder",
+ "org.junit.runners.MethodSorters"));
+ }
+
+ @Override
+ public String getOrderAnnotation() {
+ return "@FixMethodOrder(MethodSorters.NAME_ASCENDING)";
+ }
+
+ @Override
+ public String getIgnoreAnnotation() {
+ return "@Ignore";
+ }
+
+ @Override
+ public boolean annotationLevelRules() {
+ return false;
+ }
+
+ @Override
+ public String getRuleAnnotation(String annotationValue) {
+ throw new UnsupportedOperationException("Not available in JUnit.");
+ }
+
+}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/SpockDefinition.groovy b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/SpockDefinition.java
similarity index 51%
rename from spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/SpockDefinition.groovy
rename to spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/SpockDefinition.java
index 554b0f577a..8c4efb49b1 100644
--- a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/SpockDefinition.groovy
+++ b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/SpockDefinition.java
@@ -14,72 +14,74 @@
* limitations under the License.
*/
-package org.springframework.cloud.contract.verifier.config.framework
+package org.springframework.cloud.contract.verifier.config.framework;
-import groovy.transform.CompileStatic
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
/**
- * Defines elements characteristic of Spock test framework to be used during test class construction.
+ * Defines elements characteristic of Spock test framework to be used during test class
+ * construction.
*
* @author Olga Maciaszek-Sharma
- *
* @since 2.1.0
*/
-@CompileStatic
-class SpockDefinition implements TestFrameworkDefinition {
+public class SpockDefinition implements TestFrameworkDefinition {
@Override
- String getClassModifier() {
- return ''
+ public String getClassModifier() {
+ return "";
}
@Override
- String getMethodModifier() {
- return 'def '
+ public String getMethodModifier() {
+ return "def ";
}
@Override
- String getLineSuffix() {
- return ''
+ public String getLineSuffix() {
+ return "";
}
@Override
- String getClassExtension() {
- return '.groovy'
+ public String getClassExtension() {
+ return ".groovy";
}
@Override
- String getClassNameSuffix() {
- return 'Spec'
+ public String getClassNameSuffix() {
+ return "Spec";
}
@Override
- String getIgnoreClass() {
- return 'spock.lang.Ignore'
+ public String getIgnoreClass() {
+ return "spock.lang.Ignore";
}
@Override
- List getOrderAnnotationImports() {
- return ['spock.lang.Stepwise']
+ public List getOrderAnnotationImports() {
+ return new ArrayList(Arrays.asList("spock.lang.Stepwise"));
}
@Override
- String getOrderAnnotation() {
- return '@Stepwise'
+ public String getOrderAnnotation() {
+ return "@Stepwise";
}
@Override
- String getIgnoreAnnotation() {
- return '@Ignore'
+ public String getIgnoreAnnotation() {
+ return "@Ignore";
}
@Override
- boolean annotationLevelRules() {
- return false
+ public boolean annotationLevelRules() {
+ return false;
}
@Override
- String getRuleAnnotation(String annotationValue) {
- throw new UnsupportedOperationException('Not available in Spock.')
+ public String getRuleAnnotation(String annotationValue) {
+ throw new UnsupportedOperationException("Not available in Spock.");
}
+
}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/TestFrameworkDefinition.groovy b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/TestFrameworkDefinition.java
similarity index 55%
rename from spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/TestFrameworkDefinition.groovy
rename to spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/TestFrameworkDefinition.java
index e338fbf5f0..ff94da9aea 100644
--- a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/TestFrameworkDefinition.groovy
+++ b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/TestFrameworkDefinition.java
@@ -14,78 +14,84 @@
* limitations under the License.
*/
-package org.springframework.cloud.contract.verifier.config.framework
+package org.springframework.cloud.contract.verifier.config.framework;
-import groovy.transform.CompileStatic
+import java.util.List;
/**
- * Defines elements characteristic of a given test framework to be used during test class construction.
+ * Defines elements characteristic of a given test framework to be used during test class
+ * construction.
*
* @author Olga Maciaszek-Sharma
- *
* @since 2.1.0
*/
-@CompileStatic
-interface TestFrameworkDefinition {
+public interface TestFrameworkDefinition {
/**
- * @return the class access level modifier. E.g. for Java tests that would mean {@code public}
- * */
- String getClassModifier()
+ * @return the class access level modifier. E.g. for Java tests that would mean
+ * {@code public}
+ */
+ String getClassModifier();
/**
- * @return the method access level modifier along with the return type.
- * E.g. for Java tests that would mean {@code public void}
- * */
- String getMethodModifier()
+ * @return the method access level modifier along with the return type. E.g. for Java
+ * tests that would mean {@code public void}
+ */
+ String getMethodModifier();
/**
- * @return the characters that should end each line. E.g. for Java tests that would mean {@code ;}
- * */
- String getLineSuffix()
+ * @return the characters that should end each line. E.g. for Java tests that would
+ * mean {@code ;}
+ */
+ String getLineSuffix();
/**
* @return the file extension. E.g. for Java tests that would be {@code .java}
- * */
- String getClassExtension()
+ */
+ String getClassExtension();
/**
* @return the test class name suffix. E.g. for JUnit tests that would be {@code Test}
- * */
- String getClassNameSuffix()
+ */
+ String getClassNameSuffix();
/**
- * @return the qualified name of the class used to ignore or disable tests. E.g. for JUnit 4 tests that would
- * be {@code org.junit.Ignore}
- * */
- String getIgnoreClass()
+ * @return the qualified name of the class used to ignore or disable tests. E.g. for
+ * JUnit 4 tests that would be {@code org.junit.Ignore}
+ */
+ String getIgnoreClass();
/**
- * @return the qualified names of the classes that are used for arranging tests into scenarios.
- * E.g. for JUnit 4 tests that would be {@code 'org.junit.FixMethodOrder'}, {@code 'org.junit.runners.MethodSorters'}
- * */
- List getOrderAnnotationImports()
+ * @return the qualified names of the classes that are used for arranging tests into
+ * scenarios. E.g. for JUnit 4 tests that would be {@code 'org.junit.FixMethodOrder'},
+ * {@code 'org.junit.runners.MethodSorters'}
+ */
+ List getOrderAnnotationImports();
/**
- * @return the annotation used for arranging tests into scenarios.
- * E.g. for JUnit test that would be {@code @FixMethodOrder(MethodSorters.NAME_ASCENDING)}
- * */
- String getOrderAnnotation()
+ * @return the annotation used for arranging tests into scenarios. E.g. for JUnit test
+ * that would be {@code @FixMethodOrder(MethodSorters.NAME_ASCENDING)}
+ */
+ String getOrderAnnotation();
/**
- * @return the annotation used for ignoring or disabling tests. E.g. for JUnit tests that would mean {@code @Ignore}
- * */
- String getIgnoreAnnotation()
+ * @return the annotation used for ignoring or disabling tests. E.g. for JUnit tests
+ * that would mean {@code @Ignore}
+ */
+ String getIgnoreAnnotation();
/**
- * @return a boolean indicating whether an annotation-type rule or extension is being used or not.
- * E.g. for JUnit 5 tests that would return {@code true}
- * */
- boolean annotationLevelRules()
+ * @return a boolean indicating whether an annotation-type rule or extension is being
+ * used or not. E.g. for JUnit 5 tests that would return {@code true}
+ */
+ boolean annotationLevelRules();
/**
- * @return the test rule or extension annotation with the {@annotationValue} passed as an argument.
- * E.g. for JUnit 5 tests that could be {@code @ExtendWith(Example.class)}
- * */
- String getRuleAnnotation(String annotationValue)
+ * @param annotationValue value of the annotation
+ * @return the test rule or extension annotation with the {@annotationValue} passed as
+ * an argument. E.g. for JUnit 5 tests that could be
+ * {@code @ExtendWith(Example.class)}
+ */
+ String getRuleAnnotation(String annotationValue);
+
}
diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/util/AssertionUtil.groovy b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/util/AssertionUtil.java
similarity index 53%
rename from spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/util/AssertionUtil.groovy
rename to spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/util/AssertionUtil.java
index 6b8560da5e..42b2610188 100644
--- a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/util/AssertionUtil.groovy
+++ b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/util/AssertionUtil.java
@@ -14,15 +14,26 @@
* limitations under the License.
*/
-package org.springframework.cloud.contract.verifier.util
+package org.springframework.cloud.contract.verifier.util;
-import org.skyscreamer.jsonassert.JSONAssert
+import org.json.JSONException;
+import org.skyscreamer.jsonassert.JSONAssert;
-class AssertionUtil {
+public final class AssertionUtil {
- private static boolean NON_STRICT = false
+ private static boolean NON_STRICT = false;
- static void assertThatJsonsAreEqual(String expected, String actual) {
- JSONAssert.assertEquals(expected, actual, NON_STRICT)
+ private AssertionUtil() {
+ throw new IllegalStateException("You shouldn't instantiate the utility class");
}
+
+ public static void assertThatJsonsAreEqual(String expected, String actual) {
+ try {
+ JSONAssert.assertEquals(expected, actual, NON_STRICT);
+ }
+ catch (JSONException ex) {
+ throw new IllegalStateException(ex);
+ }
+ }
+
}
diff --git a/src/checkstyle/checkstyle-suppressions.xml b/src/checkstyle/checkstyle-suppressions.xml
index 925f7e88a1..f12aaf9df6 100644
--- a/src/checkstyle/checkstyle-suppressions.xml
+++ b/src/checkstyle/checkstyle-suppressions.xml
@@ -40,4 +40,5 @@
+