美文网首页
Spring boot -Spock setup

Spring boot -Spock setup

作者: jiaozenghao | 来源:发表于2018-01-19 11:32 被阅读0次

    Spring boot 项目中添加Spock

    Eclipse 需要安装groovy plugin
    IDEA 自带groovy plugin

    maven

    Add dependency

     <!-- spock start -->
                <dependency>
                    <groupId>org.spockframework</groupId>
                    <artifactId>spock-spring</artifactId>
                    <version>1.1-groovy-2.4</version>
                    <scope>test</scope>
                </dependency>
    
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-all</artifactId>
                    <version>2.4.4</version>
                    <scope>test</scope>
                </dependency>
    
                <!-- spock end -->
    
    
    

    Plugin

    <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                    <configuration>
                        <includes>
                            <include>**/*Test.java</include>
                            <include>**/*Spec.java</include>
                        </includes>
                    </configuration>
                </plugin>
    
                <plugin>
                    <groupId>org.codehaus.gmavenplus</groupId>
                    <artifactId>gmavenplus-plugin</artifactId>
                    <version>1.5</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>addTestSources</goal>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
    
    
    

    相关文章

      网友评论

          本文标题:Spring boot -Spock setup

          本文链接:https://www.haomeiwen.com/subject/xkjooxtx.html