对于Mule Munit测试案例,mvn clean测试失败了

时间:2015-10-30 10:17:33

标签: maven mule munit

我在Mule Mnuit测试用例上运行mvn clean test命令。我最终遇到API不兼容错误:

[ERROR] Failed to execute goal com.mulesoft.munit.tools:munit-maven-plugin:1.0.0:test (test) on project sunguard-session: 
Execution test of goal com.mulesoft.munit.tools:munit-maven-plugin:1.0.0:test failed: 
An API incompatibility was encountered while executing com.mulesoft.munit.tools:munit-maven-plugin:1.0.0:test: java.lang.NoSuchMethodError: org.springframework.core.MethodParameter.getContainingClass()Ljava/lang/Class;

可以解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

我们在项目中仍面临同样的问题。我们发现,为了通过maven编译测试,我们必须使用不同版本的MUNIT

<munit.version.rc1>3.6.0-RC1</munit.version.rc1>

插件

<plugin>
            <groupId>org.mule.munit.tools</groupId>
            <artifactId>munit-maven-plugin</artifactId>
            <version>${munit.version.rc1}</version>
            <executions>
                <execution>
                    <id>test</id>
                    <phase>test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

和相关的Runner

<dependency>
        <groupId>org.mule.munit</groupId>
        <artifactId>munit-runner</artifactId>
        <version>${munit.version.rc1}</version>
        <scope>test</scope>
    </dependency>