# Spring Cloud Contract Verifier Maven Plugin –

## Spring Cloud Contract Maven Plugin

## Java Project with JUnit Tests

Sample minimal configuration for Java Project with JUnit tests.

### Test dependencies for generated contract verification tests

            <dependency>
                <groupId>com.jayway.restassured</groupId>
                <artifactId>rest-assured</artifactId>
                <version>2.9.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.jayway.restassured</groupId>
                <artifactId>spring-mock-mvc</artifactId>
                <version>2.9.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.toomuchcoding.jsonassert</groupId>
                <artifactId>jsonassert</artifactId>
                <version>0.4.7</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>2.4.1</version>
                <scope>test</scope>
            </dependency>

### Project configuration for Spring Cloud Contract Verifier with JUnit tests and stub publishing

                <plugin>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
                    <version>${spring-cloud-verifier-plugin.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <baseClassForTests>hello.BaseAccurest</baseClassForTests>
                    </configuration>
                </plugin>

### Base Test class

    /**
     *
     *  Copyright 2013-2016 the original author or authors.
     *
     *  Licensed under the Apache License, Version 2.0 (the "License");
     *  you may not use this file except in compliance with the License.
     *  You may obtain a copy of the License at
     *
     *       http://www.apache.org/licenses/LICENSE-2.0
     *
     *  Unless required by applicable law or agreed to in writing, software
     *  distributed under the License is distributed on an "AS IS" BASIS,
     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     *  See the License for the specific language governing permissions and
     *  limitations under the License.
     */
    package hello;

    import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc;

    import org.junit.Before;

    public class BaseAccurest {

        @Before
        public void setup() {
            RestAssuredMockMvc.standaloneSetup(new GreetingController());
        }

    }

### Project source code

https://github.com/spring-cloud/spring-cloud-contract/tree/master/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/spring-boot-java