0

我在 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;

任何人都可以解决这个问题吗?

4

1 回答 1

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>
于 2015-12-10T16:53:28.097 回答