Open
Description
I can see unused imports when I open generated test in my IDE:
import org.junit.jupiter.api.extension.ExtendWith;
import static org.springframework.cloud.contract.verifier.util.ContractVerifierUtil.*;
Sample
My integration to contracts is like that:
<plugin>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
<version>${spring-cloud.version}</version>
<extensions>true</extensions>
<configuration>
<baseClassForTests>com.github.aha.poc.junit.springboot.AbstractContractTest</baseClassForTests>
<testFramework>JUNIT5</testFramework>
</configuration>
</plugin>
The test base class is defined as:
@SpringBootTest(webEnvironment = MOCK)
public class AbstractContractTest {
@Autowired
private WebApplicationContext context;
@BeforeEach
void setup() {
webAppContextSetup(context);
}
}
The complete example can be found here: https://github.com/arnosthavelka/junit-poc/tree/develop/spring-boot/src/test/resources/contracts/city.