Search code examples
spring-bootspring-cloud-contract

Spring Boot minimum version requirement for Spring Cloud Contract to work ?


I'm using latest Spring Boot 1.3 in my client app and I would like to introduce Spring Cloud Contract :

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.3.8.RELEASE</version>
    <relativePath/>
    <!-- lookup parent from repository -->
</parent>

I'm able to generate stubs from the producer side, but from consumer side, I'm not able to adapt the example given on https://cloud.spring.io/spring-cloud-contract/ .

I'm replacing the test runner SpringRunner (not available with Spring Boot 1.3) by SpringJUnit4ClassRunner, but the @AutoConfigureStubRunner annotation seems to be ignored.

I don't see any requirement on Spring Boot version mentioned in Spring Cloud Contract page : is there any ?


Solution

  • From my experience, it seems Spring Boot 1.4+ is required. After upgrading to

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.3.RELEASE</version>
        <relativePath/>
        <!-- lookup parent from repository -->
    </parent>
    

    I see @AutoConfigureStubRunner is taken into account.