File tree Expand file tree Collapse file tree 2 files changed +20
-42
lines changed
plugin-gradle/src/test/java/com/diffplug/gradle/spotless Expand file tree Collapse file tree 2 files changed +20
-42
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,26 @@ void removeUnusedImportsWithCleanthat() throws IOException {
8181 assertFile ("src/main/java/test.java" ).sameAsResource ("java/removeunusedimports/Jdk17TextBlockFormatted.test" );
8282 }
8383
84+ @ Test
85+ void removeWildCardImports () throws IOException {
86+ setFile ("build.gradle" ).toLines (
87+ "plugins {" ,
88+ " id 'com.diffplug.spotless'" ,
89+ "}" ,
90+ "repositories { mavenCentral() }" ,
91+ "" ,
92+ "spotless {" ,
93+ " java {" ,
94+ " target file('test.java')" ,
95+ " removeWildcardImports()" ,
96+ " }" ,
97+ "}" );
98+
99+ setFile ("test.java" ).toResource ("java/removewildcardimports/JavaCodeWildcardsUnformatted.test" );
100+ gradleRunner ().withArguments ("spotlessApply" ).build ();
101+ assertFile ("test.java" ).sameAsResource ("java/removewildcardimports/JavaCodeWildcardsFormatted.test" );
102+ }
103+
84104 /**
85105 * Triggers the special case in {@link FormatExtension#setupTask(SpotlessTask)} with {@code toggleFence} and
86106 * {@code targetExcludeContentPattern} both being not {@code null}.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments