New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Generation exception #1664
Comments
Can you paste your maven plugin configuration? |
@marcingrzejszczak <build>
<plugins>
<plugin>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
<version>${spring-cloud-contract.version}</version>
<extensions>true</extensions>
<configuration>
<baseClassForTests>
com.xzg.test.scc.BaseCase
</baseClassForTests>
</configuration>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-pact</artifactId>
<version>${spring-cloud-contract.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build> BaseCase.java @SpringBootTest(classes = SpringcloudContractProviderRestApplication.class,webEnvironment = SpringBootTest.WebEnvironment.NONE)
// remove::start[]
@AutoConfigureMessageVerifier
@EmbeddedKafka(partitions = 1, topics = {"kafka_topic"})
// remove::end[]
@ActiveProfiles("test")
public class BaseCase {
@Autowired KafkaController controller;
public void trigger() {
this.controller.sendFoo("example");
}
public void triggerMessage() {
this.controller.sendFooAsMessage("example");
}
@BeforeEach
public void setup() {
RestAssuredMockMvc.standaloneSetup(new FraudController());
}
} |
What is the |
Ah I see it's 3.0.2. You're using incompatible release trains. You're using Hoxton against contract 3.x. You should use either Hoxton and maven plugin 2.x or 2020.x and contract 3.x |
@marcingrzejszczak Oh . Thanks. |
Describe the bug
Contract generates Test class exception . There isn't contract methond.
Sample
pom
following contract:
the following test would be created. use command : mvn clean install -Dtest
And contractVerifierMessaging.send Method hasn't parameter contract.
I guess the version is wrong, but I did not find a solution.
The text was updated successfully, but these errors were encountered: