Integration Testing With Spring Cloud Contract

Spring Cloud Contract was created as a way to help test interconnected microservices. Generally speaking, there are two options when testing microservices: 1) you can deploy the entire mesh of services in your integration tests and test against that, or 2) you can mock each service in your integration tests. Both of these options have serious drawbacks.


This is a companion discussion topic for the original entry at https://developer.okta.com/blog/2022/02/01/spring-cloud-contract

Hi and thank you for this article. I am following exact steps but I am having issue at the very start with the error below as soon as I open the project in my IDE. I followed all the steps, created project and added the 3 dependencies. Adding the 3 dependencies also added spring-cloud-contract-maven-plugin plugin below

			<plugin>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-contract-maven-plugin</artifactId>
				<version>3.1.0</version>
				<extensions>true</extensions>
				<configuration>
					<testFramework>JUNIT5</testFramework>
				</configuration>
			</plugin>

This plugin is showing error below once I open project in my IDE with following error/stack trace:

Description	Resource	Path	Location	Type
Execution default-generateStubs of goal org.springframework.cloud:spring-cloud-contract-maven-plugin:3.1.0:generateStubs failed: An API incompatibility was encountered while executing org.springframework.cloud:spring-cloud-contract-maven-plugin:3.1.0:generateStubs: java.lang.NoSuchMethodError: 'void org.codehaus.plexus.util.DirectoryScanner.setFilenameComparator(java.util.Comparator)'
-----------------------------------------------------
realm =    extension>org.springframework.cloud:spring-cloud-contract-maven-plugin:3.1.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-maven-plugin/3.1.0/spring-cloud-contract-maven-plugin-3.1.0.jar
urls[1] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-verifier/3.1.0/spring-cloud-contract-verifier-3.1.0.jar
urls[2] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-spec/3.1.0/spring-cloud-contract-spec-3.1.0.jar
urls[3] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-spec-java/3.1.0/spring-cloud-contract-spec-java-3.1.0.jar
urls[4] = file:/C:/Users/ME/.m2/repository/dk/brics/automaton/automaton/1.11-8/automaton-1.11-8.jar
urls[5] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-spec-groovy/3.1.0/spring-cloud-contract-spec-groovy-3.1.0.jar
urls[6] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-shade/3.1.0/spring-cloud-contract-shade-3.1.0.jar
urls[7] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-test-autoconfigure/2.6.1/spring-boot-test-autoconfigure-2.6.1.jar
urls[8] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot/2.6.1/spring-boot-2.6.1.jar
urls[9] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-test/2.6.1/spring-boot-test-2.6.1.jar
urls[10] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.6.1/spring-boot-autoconfigure-2.6.1.jar
urls[11] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.0/jackson-databind-2.13.0.jar
urls[12] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar
urls[13] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.0/jackson-core-2.13.0.jar
urls[14] = file:/C:/Users/ME/.m2/repository/org/apache/commons/commons-text/1.9/commons-text-1.9.jar
urls[15] = file:/C:/Users/ME/.m2/repository/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar
urls[16] = file:/C:/Users/ME/.m2/repository/com/github/tomakehurst/wiremock-jre8-standalone/2.31.0/wiremock-jre8-standalone-2.31.0.jar
urls[17] = file:/C:/Users/ME/.m2/repository/com/toomuchcoding/jsonassert/jsonassert/0.6.1/jsonassert-0.6.1.jar
urls[18] = file:/C:/Users/ME/.m2/repository/com/jayway/jsonpath/json-path/2.6.0/json-path-2.6.0.jar
urls[19] = file:/C:/Users/ME/.m2/repository/net/minidev/json-smart/2.4.7/json-smart-2.4.7.jar
urls[20] = file:/C:/Users/ME/.m2/repository/net/minidev/accessors-smart/2.4.7/accessors-smart-2.4.7.jar
urls[21] = file:/C:/Users/ME/.m2/repository/org/ow2/asm/asm/9.1/asm-9.1.jar
urls[22] = file:/C:/Users/ME/.m2/repository/com/rackspace/eclipse/webtools/sourceediting/org.eclipse.wst.xml.xpath2.processor/2.1.100/org.eclipse.wst.xml.xpath2.processor-2.1.100.jar
urls[23] = file:/C:/Users/ME/.m2/repository/edu/princeton/cup/java-cup/10k/java-cup-10k.jar
urls[24] = file:/C:/Users/ME/.m2/repository/com/ibm/icu/icu4j/4.6/icu4j-4.6.jar
urls[25] = file:/C:/Users/ME/.m2/repository/org/codehaus/groovy/groovy/3.0.9/groovy-3.0.9.jar
urls[26] = file:/C:/Users/ME/.m2/repository/org/codehaus/groovy/groovy-nio/3.0.9/groovy-nio-3.0.9.jar
urls[27] = file:/C:/Users/ME/.m2/repository/org/codehaus/groovy/groovy-json/3.0.9/groovy-json-3.0.9.jar
urls[28] = file:/C:/Users/ME/.m2/repository/org/codehaus/groovy/groovy-xml/3.0.9/groovy-xml-3.0.9.jar
urls[29] = file:/C:/Users/ME/.m2/repository/org/skyscreamer/jsonassert/1.5.0/jsonassert-1.5.0.jar
urls[30] = file:/C:/Users/ME/.m2/repository/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar
urls[31] = file:/C:/Users/ME/.m2/repository/com/github/jknack/handlebars/4.2.0/handlebars-4.2.0.jar
urls[32] = file:/C:/Users/ME/.m2/repository/commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.jar
urls[33] = file:/C:/Users/ME/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
urls[34] = file:/C:/Users/ME/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar
urls[35] = file:/C:/Users/ME/.m2/repository/org/yaml/snakeyaml/1.29/snakeyaml-1.29.jar
urls[36] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.13.0/jackson-dataformat-yaml-2.13.0.jar
urls[37] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-starter-test/2.6.1/spring-boot-starter-test-2.6.1.jar
urls[38] = file:/C:/Users/ME/.m2/repository/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3.jar
urls[39] = file:/C:/Users/ME/.m2/repository/jakarta/activation/jakarta.activation-api/1.2.2/jakarta.activation-api-1.2.2.jar
urls[40] = file:/C:/Users/ME/.m2/repository/org/hamcrest/hamcrest/2.2/hamcrest-2.2.jar
urls[41] = file:/C:/Users/ME/.m2/repository/org/junit/jupiter/junit-jupiter/5.8.1/junit-jupiter-5.8.1.jar
urls[42] = file:/C:/Users/ME/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.8.1/junit-jupiter-params-5.8.1.jar
urls[43] = file:/C:/Users/ME/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.8.1/junit-jupiter-engine-5.8.1.jar
urls[44] = file:/C:/Users/ME/.m2/repository/org/junit/platform/junit-platform-engine/1.8.1/junit-platform-engine-1.8.1.jar
urls[45] = file:/C:/Users/ME/.m2/repository/org/mockito/mockito-junit-jupiter/4.0.0/mockito-junit-jupiter-4.0.0.jar
urls[46] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-core/5.3.13/spring-core-5.3.13.jar
urls[47] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-test/5.3.13/spring-test-5.3.13.jar
urls[48] = file:/C:/Users/ME/.m2/repository/org/xmlunit/xmlunit-core/2.8.3/xmlunit-core-2.8.3.jar
urls[49] = file:/C:/Users/ME/.m2/repository/net/javacrumbs/json-unit/json-unit-assertj/2.27.0/json-unit-assertj-2.27.0.jar
urls[50] = file:/C:/Users/ME/.m2/repository/net/javacrumbs/json-unit/json-unit-core/2.27.0/json-unit-core-2.27.0.jar
urls[51] = file:/C:/Users/ME/.m2/repository/net/javacrumbs/json-unit/json-unit-json-path/2.27.0/json-unit-json-path-2.27.0.jar
urls[52] = file:/C:/Users/ME/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.8.1/junit-jupiter-api-5.8.1.jar
urls[53] = file:/C:/Users/ME/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar
urls[54] = file:/C:/Users/ME/.m2/repository/org/junit/platform/junit-platform-commons/1.8.1/junit-platform-commons-1.8.1.jar
urls[55] = file:/C:/Users/ME/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar
urls[56] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-function-compiler/3.0.6.RELEASE/spring-cloud-function-compiler-3.0.6.RELEASE.jar
urls[57] = file:/C:/Users/ME/.m2/repository/io/projectreactor/reactor-core/3.4.12/reactor-core-3.4.12.jar
urls[58] = file:/C:/Users/ME/.m2/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar
urls[59] = file:/C:/Users/ME/.m2/repository/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.jar
urls[60] = file:/C:/Users/ME/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar
urls[61] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-converters/3.1.0/spring-cloud-contract-converters-3.1.0.jar
urls[62] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-context/5.3.13/spring-context-5.3.13.jar
urls[63] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-aop/5.3.13/spring-aop-5.3.13.jar
urls[64] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-beans/5.3.13/spring-beans-5.3.13.jar
urls[65] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-expression/5.3.13/spring-expression-5.3.13.jar
urls[66] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.6.1/spring-boot-starter-logging-2.6.1.jar
urls[67] = file:/C:/Users/ME/.m2/repository/ch/qos/logback/logback-classic/1.2.7/logback-classic-1.2.7.jar
urls[68] = file:/C:/Users/ME/.m2/repository/org/slf4j/jul-to-slf4j/1.7.32/jul-to-slf4j-1.7.32.jar
urls[69] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-stub-runner/3.1.0/spring-cloud-contract-stub-runner-3.1.0.jar
urls[70] = file:/C:/Users/ME/.m2/repository/org/eclipse/jgit/org.eclipse.jgit/5.12.0.202106070339-r/org.eclipse.jgit-5.12.0.202106070339-r.jar
urls[71] = file:/C:/Users/ME/.m2/repository/com/googlecode/javaewah/JavaEWAH/1.1.7/JavaEWAH-1.1.7.jar
urls[72] = file:/C:/Users/ME/.m2/repository/org/eclipse/jgit/org.eclipse.jgit.ssh.jsch/5.12.0.202106070339-r/org.eclipse.jgit.ssh.jsch-5.12.0.202106070339-r.jar
urls[73] = file:/C:/Users/ME/.m2/repository/com/jcraft/jsch/0.1.55/jsch-0.1.55.jar
urls[74] = file:/C:/Users/ME/.m2/repository/com/jcraft/jzlib/1.1.1/jzlib-1.1.1.jar
urls[75] = file:/C:/Users/ME/.m2/repository/com/jcraft/jsch.agentproxy.sshagent/0.0.9/jsch.agentproxy.sshagent-0.0.9.jar
urls[76] = file:/C:/Users/ME/.m2/repository/com/jcraft/jsch.agentproxy.core/0.0.9/jsch.agentproxy.core-0.0.9.jar
urls[77] = file:/C:/Users/ME/.m2/repository/com/jcraft/jsch.agentproxy.jsch/0.0.9/jsch.agentproxy.jsch-0.0.9.jar
urls[78] = file:/C:/Users/ME/.m2/repository/com/jcraft/jsch.agentproxy.usocket-jna/0.0.9/jsch.agentproxy.usocket-jna-0.0.9.jar
urls[79] = file:/C:/Users/ME/.m2/repository/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar
urls[80] = file:/C:/Users/ME/.m2/repository/net/java/dev/jna/jna-platform/4.1.0/jna-platform-4.1.0.jar
urls[81] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-wiremock/3.1.0/spring-cloud-contract-wiremock-3.1.0.jar
urls[82] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-starter/2.6.1/spring-boot-starter-2.6.1.jar
urls[83] = file:/C:/Users/ME/.m2/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar
urls[84] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-web/5.3.13/spring-web-5.3.13.jar
urls[85] = file:/C:/Users/ME/.m2/repository/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar
urls[86] = file:/C:/Users/ME/.m2/repository/org/apache/httpcomponents/httpcore/4.4.14/httpcore-4.4.14.jar
urls[87] = file:/C:/Users/ME/.m2/repository/commons-codec/commons-codec/1.15/commons-codec-1.15.jar
urls[88] = file:/C:/Users/ME/.m2/repository/org/assertj/assertj-core/3.21.0/assertj-core-3.21.0.jar
urls[89] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.6.1/spring-boot-starter-web-2.6.1.jar
urls[90] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.6.1/spring-boot-starter-json-2.6.1.jar
urls[91] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.13.0/jackson-datatype-jdk8-2.13.0.jar
urls[92] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.13.0/jackson-datatype-jsr310-2.13.0.jar
urls[93] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.13.0/jackson-module-parameter-names-2.13.0.jar
urls[94] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.6.1/spring-boot-starter-tomcat-2.6.1.jar
urls[95] = file:/C:/Users/ME/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.55/tomcat-embed-core-9.0.55.jar
urls[96] = file:/C:/Users/ME/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.55/tomcat-embed-el-9.0.55.jar
urls[97] = file:/C:/Users/ME/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.55/tomcat-embed-websocket-9.0.55.jar
urls[98] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-webmvc/5.3.13/spring-webmvc-5.3.13.jar
urls[99] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-jcl/5.3.13/spring-jcl-5.3.13.jar
urls[100] = file:/C:/Users/ME/.m2/repository/org/apache/maven/shared/maven-filtering/3.1.1/maven-filtering-3.1.1.jar
urls[101] = file:/C:/Users/ME/.m2/repository/org/apache/maven/maven-builder-support/3.6.3/maven-builder-support-3.6.3.jar
urls[102] = file:/C:/Users/ME/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
urls[103] = file:/C:/Users/ME/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.6.0/sisu-inject-bean-2.6.0.jar
urls[104] = file:/C:/Users/ME/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
urls[105] = file:/C:/Users/ME/.m2/repository/org/sonatype/sisu/sisu-guice/3.2.6/sisu-guice-3.2.6-no_aop.jar
urls[106] = file:/C:/Users/ME/.m2/repository/com/google/guava/guava/16.0.1/guava-16.0.1.jar
urls[107] = file:/C:/Users/ME/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.3/org.eclipse.sisu.inject-0.3.3.jar
urls[108] = file:/C:/Users/ME/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[109] = file:/C:/Users/ME/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[110] = file:/C:/Users/ME/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.jar
urls[111] = file:/C:/Users/ME/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
urls[112] = file:/C:/Users/ME/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar
urls[113] = file:/C:/Users/ME/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.22/plexus-interpolation-1.22.jar
urls[114] = file:/C:/Users/ME/.m2/repository/ch/qos/logback/logback-core/1.2.7/logback-core-1.2.7.jar
urls[115] = file:/C:/Users/ME/.m2/repository/org/apache/maven/maven-archiver/3.5.1/maven-archiver-3.5.1.jar
urls[116] = file:/C:/Users/ME/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar
urls[117] = file:/C:/Users/ME/.m2/repository/org/codehaus/plexus/plexus-archiver/4.2.5/plexus-archiver-4.2.5.jar
urls[118] = file:/C:/Users/ME/.m2/repository/org/codehaus/plexus/plexus-io/3.2.0/plexus-io-3.2.0.jar
urls[119] = file:/C:/Users/ME/.m2/repository/org/apache/commons/commons-compress/1.20/commons-compress-1.20.jar
urls[120] = file:/C:/Users/ME/.m2/repository/org/iq80/snappy/snappy/0.4/snappy-0.4.jar
urls[121] = file:/C:/Users/ME/.m2/repository/org/tukaani/xz/1.9/xz-1.9.jar
urls[122] = file:/C:/Users/ME/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.jar
urls[123] = file:/C:/Users/ME/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.jar
Number of foreign imports: 5
import: Entry[import org.sonatype.plexus.build.incremental from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.Scanner from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.DirectoryScanner from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import org.codehaus.plexus.util.AbstractScanner from realm ClassRealm[plexus.core, parent: null]]
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------
 (org.springframework.cloud:spring-cloud-contract-maven-plugin:3.1.0:generateStubs:default-generateStubs:package)

org.apache.maven.plugin.PluginExecutionException: Execution default-generateStubs of goal org.springframework.cloud:spring-cloud-contract-maven-plugin:3.1.0:generateStubs failed: An API incompatibility was encountered while executing org.springframework.cloud:spring-cloud-contract-maven-plugin:3.1.0:generateStubs: java.lang.NoSuchMethodError: 'void org.codehaus.plexus.util.DirectoryScanner.setFilenameComparator(java.util.Comparator)'
-----------------------------------------------------
realm =    extension>org.springframework.cloud:spring-cloud-contract-maven-plugin:3.1.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-maven-plugin/3.1.0/spring-cloud-contract-maven-plugin-3.1.0.jar
urls[1] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-verifier/3.1.0/spring-cloud-contract-verifier-3.1.0.jar
urls[2] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-spec/3.1.0/spring-cloud-contract-spec-3.1.0.jar
urls[3] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-spec-java/3.1.0/spring-cloud-contract-spec-java-3.1.0.jar
urls[4] = file:/C:/Users/ME/.m2/repository/dk/brics/automaton/automaton/1.11-8/automaton-1.11-8.jar
urls[5] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-spec-groovy/3.1.0/spring-cloud-contract-spec-groovy-3.1.0.jar
urls[6] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-shade/3.1.0/spring-cloud-contract-shade-3.1.0.jar
urls[7] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-test-autoconfigure/2.6.1/spring-boot-test-autoconfigure-2.6.1.jar
urls[8] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot/2.6.1/spring-boot-2.6.1.jar
urls[9] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-test/2.6.1/spring-boot-test-2.6.1.jar
urls[10] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.6.1/spring-boot-autoconfigure-2.6.1.jar
urls[11] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.0/jackson-databind-2.13.0.jar
urls[12] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.0/jackson-annotations-2.13.0.jar
urls[13] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.0/jackson-core-2.13.0.jar
urls[14] = file:/C:/Users/ME/.m2/repository/org/apache/commons/commons-text/1.9/commons-text-1.9.jar
urls[15] = file:/C:/Users/ME/.m2/repository/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar
urls[16] = file:/C:/Users/ME/.m2/repository/com/github/tomakehurst/wiremock-jre8-standalone/2.31.0/wiremock-jre8-standalone-2.31.0.jar
urls[17] = file:/C:/Users/ME/.m2/repository/com/toomuchcoding/jsonassert/jsonassert/0.6.1/jsonassert-0.6.1.jar
urls[18] = file:/C:/Users/ME/.m2/repository/com/jayway/jsonpath/json-path/2.6.0/json-path-2.6.0.jar
urls[19] = file:/C:/Users/ME/.m2/repository/net/minidev/json-smart/2.4.7/json-smart-2.4.7.jar
urls[20] = file:/C:/Users/ME/.m2/repository/net/minidev/accessors-smart/2.4.7/accessors-smart-2.4.7.jar
urls[21] = file:/C:/Users/ME/.m2/repository/org/ow2/asm/asm/9.1/asm-9.1.jar
urls[22] = file:/C:/Users/ME/.m2/repository/com/rackspace/eclipse/webtools/sourceediting/org.eclipse.wst.xml.xpath2.processor/2.1.100/org.eclipse.wst.xml.xpath2.processor-2.1.100.jar
urls[23] = file:/C:/Users/ME/.m2/repository/edu/princeton/cup/java-cup/10k/java-cup-10k.jar
urls[24] = file:/C:/Users/ME/.m2/repository/com/ibm/icu/icu4j/4.6/icu4j-4.6.jar
urls[25] = file:/C:/Users/ME/.m2/repository/org/codehaus/groovy/groovy/3.0.9/groovy-3.0.9.jar
urls[26] = file:/C:/Users/ME/.m2/repository/org/codehaus/groovy/groovy-nio/3.0.9/groovy-nio-3.0.9.jar
urls[27] = file:/C:/Users/ME/.m2/repository/org/codehaus/groovy/groovy-json/3.0.9/groovy-json-3.0.9.jar
urls[28] = file:/C:/Users/ME/.m2/repository/org/codehaus/groovy/groovy-xml/3.0.9/groovy-xml-3.0.9.jar
urls[29] = file:/C:/Users/ME/.m2/repository/org/skyscreamer/jsonassert/1.5.0/jsonassert-1.5.0.jar
urls[30] = file:/C:/Users/ME/.m2/repository/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar
urls[31] = file:/C:/Users/ME/.m2/repository/com/github/jknack/handlebars/4.2.0/handlebars-4.2.0.jar
urls[32] = file:/C:/Users/ME/.m2/repository/commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.jar
urls[33] = file:/C:/Users/ME/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
urls[34] = file:/C:/Users/ME/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar
urls[35] = file:/C:/Users/ME/.m2/repository/org/yaml/snakeyaml/1.29/snakeyaml-1.29.jar
urls[36] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.13.0/jackson-dataformat-yaml-2.13.0.jar
urls[37] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-starter-test/2.6.1/spring-boot-starter-test-2.6.1.jar
urls[38] = file:/C:/Users/ME/.m2/repository/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3.jar
urls[39] = file:/C:/Users/ME/.m2/repository/jakarta/activation/jakarta.activation-api/1.2.2/jakarta.activation-api-1.2.2.jar
urls[40] = file:/C:/Users/ME/.m2/repository/org/hamcrest/hamcrest/2.2/hamcrest-2.2.jar
urls[41] = file:/C:/Users/ME/.m2/repository/org/junit/jupiter/junit-jupiter/5.8.1/junit-jupiter-5.8.1.jar
urls[42] = file:/C:/Users/ME/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.8.1/junit-jupiter-params-5.8.1.jar
urls[43] = file:/C:/Users/ME/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.8.1/junit-jupiter-engine-5.8.1.jar
urls[44] = file:/C:/Users/ME/.m2/repository/org/junit/platform/junit-platform-engine/1.8.1/junit-platform-engine-1.8.1.jar
urls[45] = file:/C:/Users/ME/.m2/repository/org/mockito/mockito-junit-jupiter/4.0.0/mockito-junit-jupiter-4.0.0.jar
urls[46] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-core/5.3.13/spring-core-5.3.13.jar
urls[47] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-test/5.3.13/spring-test-5.3.13.jar
urls[48] = file:/C:/Users/ME/.m2/repository/org/xmlunit/xmlunit-core/2.8.3/xmlunit-core-2.8.3.jar
urls[49] = file:/C:/Users/ME/.m2/repository/net/javacrumbs/json-unit/json-unit-assertj/2.27.0/json-unit-assertj-2.27.0.jar
urls[50] = file:/C:/Users/ME/.m2/repository/net/javacrumbs/json-unit/json-unit-core/2.27.0/json-unit-core-2.27.0.jar
urls[51] = file:/C:/Users/ME/.m2/repository/net/javacrumbs/json-unit/json-unit-json-path/2.27.0/json-unit-json-path-2.27.0.jar
urls[52] = file:/C:/Users/ME/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.8.1/junit-jupiter-api-5.8.1.jar
urls[53] = file:/C:/Users/ME/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar
urls[54] = file:/C:/Users/ME/.m2/repository/org/junit/platform/junit-platform-commons/1.8.1/junit-platform-commons-1.8.1.jar
urls[55] = file:/C:/Users/ME/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar
urls[56] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-function-compiler/3.0.6.RELEASE/spring-cloud-function-compiler-3.0.6.RELEASE.jar
urls[57] = file:/C:/Users/ME/.m2/repository/io/projectreactor/reactor-core/3.4.12/reactor-core-3.4.12.jar
urls[58] = file:/C:/Users/ME/.m2/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar
urls[59] = file:/C:/Users/ME/.m2/repository/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.jar
urls[60] = file:/C:/Users/ME/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar
urls[61] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-converters/3.1.0/spring-cloud-contract-converters-3.1.0.jar
urls[62] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-context/5.3.13/spring-context-5.3.13.jar
urls[63] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-aop/5.3.13/spring-aop-5.3.13.jar
urls[64] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-beans/5.3.13/spring-beans-5.3.13.jar
urls[65] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-expression/5.3.13/spring-expression-5.3.13.jar
urls[66] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.6.1/spring-boot-starter-logging-2.6.1.jar
urls[67] = file:/C:/Users/ME/.m2/repository/ch/qos/logback/logback-classic/1.2.7/logback-classic-1.2.7.jar
urls[68] = file:/C:/Users/ME/.m2/repository/org/slf4j/jul-to-slf4j/1.7.32/jul-to-slf4j-1.7.32.jar
urls[69] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-stub-runner/3.1.0/spring-cloud-contract-stub-runner-3.1.0.jar
urls[70] = file:/C:/Users/ME/.m2/repository/org/eclipse/jgit/org.eclipse.jgit/5.12.0.202106070339-r/org.eclipse.jgit-5.12.0.202106070339-r.jar
urls[71] = file:/C:/Users/ME/.m2/repository/com/googlecode/javaewah/JavaEWAH/1.1.7/JavaEWAH-1.1.7.jar
urls[72] = file:/C:/Users/ME/.m2/repository/org/eclipse/jgit/org.eclipse.jgit.ssh.jsch/5.12.0.202106070339-r/org.eclipse.jgit.ssh.jsch-5.12.0.202106070339-r.jar
urls[73] = file:/C:/Users/ME/.m2/repository/com/jcraft/jsch/0.1.55/jsch-0.1.55.jar
urls[74] = file:/C:/Users/ME/.m2/repository/com/jcraft/jzlib/1.1.1/jzlib-1.1.1.jar
urls[75] = file:/C:/Users/ME/.m2/repository/com/jcraft/jsch.agentproxy.sshagent/0.0.9/jsch.agentproxy.sshagent-0.0.9.jar
urls[76] = file:/C:/Users/ME/.m2/repository/com/jcraft/jsch.agentproxy.core/0.0.9/jsch.agentproxy.core-0.0.9.jar
urls[77] = file:/C:/Users/ME/.m2/repository/com/jcraft/jsch.agentproxy.jsch/0.0.9/jsch.agentproxy.jsch-0.0.9.jar
urls[78] = file:/C:/Users/ME/.m2/repository/com/jcraft/jsch.agentproxy.usocket-jna/0.0.9/jsch.agentproxy.usocket-jna-0.0.9.jar
urls[79] = file:/C:/Users/ME/.m2/repository/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar
urls[80] = file:/C:/Users/ME/.m2/repository/net/java/dev/jna/jna-platform/4.1.0/jna-platform-4.1.0.jar
urls[81] = file:/C:/Users/ME/.m2/repository/org/springframework/cloud/spring-cloud-contract-wiremock/3.1.0/spring-cloud-contract-wiremock-3.1.0.jar
urls[82] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-starter/2.6.1/spring-boot-starter-2.6.1.jar
urls[83] = file:/C:/Users/ME/.m2/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar
urls[84] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-web/5.3.13/spring-web-5.3.13.jar
urls[85] = file:/C:/Users/ME/.m2/repository/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar
urls[86] = file:/C:/Users/ME/.m2/repository/org/apache/httpcomponents/httpcore/4.4.14/httpcore-4.4.14.jar
urls[87] = file:/C:/Users/ME/.m2/repository/commons-codec/commons-codec/1.15/commons-codec-1.15.jar
urls[88] = file:/C:/Users/ME/.m2/repository/org/assertj/assertj-core/3.21.0/assertj-core-3.21.0.jar
urls[89] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.6.1/spring-boot-starter-web-2.6.1.jar
urls[90] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.6.1/spring-boot-starter-json-2.6.1.jar
urls[91] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.13.0/jackson-datatype-jdk8-2.13.0.jar
urls[92] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.13.0/jackson-datatype-jsr310-2.13.0.jar
urls[93] = file:/C:/Users/ME/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.13.0/jackson-module-parameter-names-2.13.0.jar
urls[94] = file:/C:/Users/ME/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.6.1/spring-boot-starter-tomcat-2.6.1.jar
urls[95] = file:/C:/Users/ME/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.55/tomcat-embed-core-9.0.55.jar
urls[96] = file:/C:/Users/ME/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.55/tomcat-embed-el-9.0.55.jar
urls[97] = file:/C:/Users/ME/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.55/tomcat-embed-websocket-9.0.55.jar
urls[98] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-webmvc/5.3.13/spring-webmvc-5.3.13.jar
urls[99] = file:/C:/Users/ME/.m2/repository/org/springframework/spring-jcl/5.3.13/spring-jcl-5.3.13.jar
urls[100] = file:/C:/Users/ME/.m2/repository/org/apache/maven/shared/maven-filtering/3.1.1/maven-filtering-3.1.1.jar
urls[101] = file:/C:/Users/ME/.m2/repository/org/apache/maven/maven-builder-support/3.6.3/maven-builder-support-3.6.3.jar
urls[102] = file:/C:/Users/ME/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
urls[103] = file:/C:/Users/ME/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.6.0/sisu-inject-bean-2.6.0.jar
urls[104] = file:/C:/Users/ME/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
urls[105] = file:/C:/Users/ME/.m2/repository/org/sonatype/sisu/sisu-guice/3.2.6/sisu-guice-3.2.6-no_aop.jar
urls[106] = file:/C:/Users/ME/.m2/repository/com/google/guava/guava/16.0.1/guava-16.0.1.jar
urls[107] = file:/C:/Users/ME/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.3/org.eclipse.sisu.inject-0.3.3.jar
urls[108] = file:/C:/Users/ME/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[109] = file:/C:/Users/ME/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[110] = file:/C:/Users/ME/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.jar
urls[111] = file:/C:/Users/ME/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
urls[112] = file:/C:/Users/ME/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar
urls[113] = file:/C:/Users/ME/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.22/plexus-interpolation-1.22.jar
urls[114] = file:/C:/Users/ME/.m2/repository/ch/qos/logback/logback-core/1.2.7/logback-core-1.2.7.jar
urls[115] = file:/C:/Users/ME/.m2/repository/org/apache/maven/maven-archiver/3.5.1/maven-archiver-3.5.1.jar
urls[116] = file:/C:/Users/ME/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar
urls[117] = file:/C:/Users/ME/.m2/repository/org/codehaus/plexus/plexus-archiver/4.2.5/plexus-archiver-4.2.5.jar
urls[118] = file:/C:/Users/ME/.m2/repository/org/codehaus/plexus/plexus-io/3.2.0/plexus-io-3.2.0.jar
urls[119] = file:/C:/Users/ME/.m2/repository/org/apache/commons/commons-compress/1.20/commons-compress-1.20.jar
urls[120] = file:/C:/Users/ME/.m2/repository/org/iq80/snappy/snappy/0.4/snappy-0.4.jar
urls[121] = file:/C:/Users/ME/.m2/repository/org/tukaani/xz/1.9/xz-1.9.jar
urls[122] = file:/C:/Users/ME/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.jar
urls[123] = file:/C:/Users/ME/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.jar
...

Hmmmm, I didn’t have any issues when doing this tutorial in IntelliJ IDEA. Maybe you can try cloning the finished example? There are instructions for how to run it in its README.

git clone https://github.com/oktadev/okta-spring-cloud-contract-example

I am just finishing section “Add Identity with Okta” and that all works fine. However, I started noticing that if I issue ./mvnw test, it runs fine. But if I issue ./mvnw clean install, I am getting error

[ERROR] ContractVerifierTest.validate_find_hat_by_id:38 » IllegalState Parsed JSON [{"...

Which is really strange since I can retrieve JSon for all 3 hats (first 2 as 200, and 3rd as 404). So, it looks like everything is ok but ./mvnw clean install returns above error?

Are you able to reproduce this error with the example or do you have a GitHub repo you can upload your project to?

I dont think the problem is the code. It is same code. Anyways, I dont see the error above anymore but now the getMessage method in Consumer throws 401 UNAUTHORIZED when I call
ResponseEntity<Hat> response = restTemplate.exchange("http://localhost:" + producerPort + "/hat/{hatId}", HttpMethod.GET, requestEntity, Hat.class, personId);

Also, above, I think personId should probably be hatId but that is unrelated to error I am getting.

Can you please provide the steps to reproduce from cloning the code repository to seeing the error?

I’m sorry if I don’t respond in the next week, I’ll be OOO next week.