spring-boot - 部署时 Maven 没有运行我的 mockito 测试

标签 spring-boot maven junit deployment mockito

我的项目中有mockito测试。我想部署我的项目,但部署时 Maven 没有运行一些测试。

enter image description here

这是我的部署 View 。

enter image description here

最佳答案

<plugins>
   <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>3.0.0-M5</version>
      <dependencies>
         <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-junit47</artifactId>
            <version>3.0.0-M5</version>
         </dependency>
      </dependencies>
   </plugin>
</plugins>

之前,我也遇到过同样的问题。我不知道你的 pom.xml 但当我添加这个依赖项时它起作用了。如果您的 pom.xml 中还没有这个,您可以尝试一下。

关于spring-boot - 部署时 Maven 没有运行我的 mockito 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64488755/

相关文章:

eclipse - 在 Eclipse 中运行单个 JUnit 测试

java - 使用匹配器断言 Collection 包含 2 个具有相同属性的对象

java - Junit:用反射测试 Spring(自动)接线?

java - 简单的 Spring @CreatedDate 注释对我不起作用

spring - 如何在@SpringBootTest 中排除ApplicationContextInitializers?

Spring Boot 从 2.3.6.RELEASE 迁移到 2.4.0 和 json ClassCastException

android - 我如何在 Maven 中使用 andengine?

java - 将特定依赖项打包到 jar 中

java - Spring Boot 1.4 测试 : Configuration error: found multiple declarations of @BootstrapWith

java - 在插件 com.google.appengine :appengine-maven-plugin 中找不到目标 'run'