Skip to content

Commit 246c739

Browse files
committed
Bring selfie back.
1 parent e0bc6f7 commit 246c739

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

plugin-maven/src/test/java/com/diffplug/spotless/maven/java/ForbidWildcardImportsStepTest.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ void testRemoveWildcardImports() throws Exception {
2727

2828
String path = "src/main/java/test.java";
2929
setFile(path).toResource("java/removewildcardimports/JavaCodeWildcardsUnformatted.test");
30-
mavenRunner().withArguments("spotless:apply").runNoError();
31-
assertFile(path).sameAsResource("java/removewildcardimports/JavaCodeWildcardsFormatted.test");
30+
var selfie = expectSelfieErrorMsg(mavenRunner().withArguments("spotless:apply").runHasError());
31+
assertFile(path).sameAsResource("java/removewildcardimports/JavaCodeWildcardsUnformatted.test");
32+
selfie.toBe("""
33+
Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:VERSION:apply (default-cli) on project spotless-maven-plugin-tests: There were 5 lint error(s), they must be fixed or suppressed.
34+
src/main/java/test.java:L1 forbidWildcardImports(import java.util.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
35+
src/main/java/test.java:L2 forbidWildcardImports(import static java.util.Collections.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
36+
src/main/java/test.java:L5 forbidWildcardImports(import io.quarkus.maven.dependency.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
37+
src/main/java/test.java:L6 forbidWildcardImports(import static io.quarkus.vertx.web.Route.HttpMethod.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
38+
src/main/java/test.java:L7 forbidWildcardImports(import static org.springframework.web.reactive.function.BodyInserters.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
39+
Resolve these lints or suppress with `<lintSuppressions>`
40+
""");
3241
}
3342
}

0 commit comments

Comments
 (0)