我正在尝试在Spring(https://spring.io/projects/spring-cloud-contract)中创建合同
这是我不断收到的错误:
测试错误:ContractVerifierTest.validate_shouldReturnPreviousAddress:19»NoClassDefFound
这是导致问题的行:
// given:
MockMvcRequestSpecification request = given();
这是我的常规文件:
package contracts import org.springframework.cloud.contract.spec.Contract Contract.make { request { method 'GET' url value(consumer('/echo'), producer('/echo')) } response { status 200 headers { header( 'Content-Type', value(consumer('text/plain;charset=ISO-8859-1'), producer(regex('text/plain;charset=ISO-8859-1'))) ) } body( "Send me something!" ) } priority 1 }
我在pom文件中包含以下内容:
<build>
<plugins>
<plugin>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
<version>1.2.2.RELEASE</version>
<extensions>true</extensions>
<configuration>
<baseClassForTests>[baseClass link]</baseClassForTests>
</configuration>
</plugin>
</plugins>
</build>
据我所知,导致此问题的行是正确的。还有其他我可能会想念的东西吗?
编辑:
仔细检查,这似乎是问题的真正原因:
java.lang.NoClassDefFoundError:io / restassured / internal / common / assertion / AssertParameter