soapUI and JUnit dependency issue

2019-06-02 19:43发布

I'm trying to use soapUI integrated to JUnit. I've tried to add the dependencies as mentioned here but it doesn't work. Some classes are not found.

In this post, it is proposed to add the soapui/lib directory to the classpath but this is not really a good practice with Maven.

Do you know which dependency(ies) to add to my project in order to integrate soapUI to JUnit?

Thanks

2条回答
等我变得足够好
2楼-- · 2019-06-02 19:49

Depending on what you're trying to do with SoapUI, you may be able to use its Maven plugin, rather than try to integrate it with JUnit: http://www.soapui.org/Test-Automation/maven-2x.html. You can use this to e.g. start a SoapUI mock server, run integration tests that call a web service, then stop the mock server upon completion of the tests. See also the Failsafe plugin if you want to do this.

Failing that, you could add the Maven plugin to your test classpath. This should also pull in all of the dependencies required to run SoapUI itself:

<dependencies>
  <dependency>
    <groupId>eviware</groupId>
    <artifactId>maven-soapui-plugin</artifactId>
    <version>4.5.0</version>
    <scope>test</scope>
  </dependency>
</dependencies>
<repositories>
  <repository>
    <id>eviware</id>
    <url>http://www.eviware.com/repository/maven2/</url>
  </repository>
</repositories>
查看更多
等我变得足够好
3楼-- · 2019-06-02 19:58

You need to create an ext folder under your project and add your dependencies there. This is the directory SoapUI runner will look into, for all your external dependencies.

查看更多
登录 后发表回答