当我运行测试但测试失败并按下按钮 Rerun failed tests
时,我收到以下错误 Test events where not received
No tests found for given includes
,但很奇怪,因为测试刚刚运行并失败,并且当我尝试使用按钮重新运行它时重新运行测试不起作用。
我正在使用 gradle 6.8.1
intellij idea community edition 2020.3.2
和 spring boot 2.4.2
这是我的build.gradle
plugins {
id 'org.springframework.boot' version '2.4.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.mapstruct:mapstruct:1.4.2.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.4.2.Final'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
这是我的测试
package com.example.map.struc.example;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import static org.junit.jupiter.api.Assertions.assertTrue;
@SpringBootTest
class MapStrucExampleApplicationTests {
@Test
void contextLoads() {
}
@Test
void name() {
assertTrue(false);
}
}