Skip to content

Commit

Permalink
Remove testcase in replacement test and use different import
Browse files Browse the repository at this point in the history
  • Loading branch information
Badbond committed Mar 18, 2022
1 parent 767d203 commit 3cf1a2c
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void identification() {
" }",
"",
" // BUG: Diagnostic contains:",
" @UseImportPolicy(ImportPolicy.STATIC_IMPORT_ALWAYS)",
" @UseImportPolicy(ImportPolicy.IMPORT_TOP_LEVEL)",
" @AfterTemplate",
" void m2() {}",
"",
Expand All @@ -120,9 +120,6 @@ void replacement() {
"import com.google.common.base.Predicates;",
"import com.google.common.collect.ImmutableMap;",
"import com.google.common.collect.ImmutableSet;",
"import com.google.errorprone.refaster.ImportPolicy;",
"import com.google.errorprone.refaster.annotation.AfterTemplate;",
"import com.google.errorprone.refaster.annotation.UseImportPolicy;",
"import java.nio.charset.StandardCharsets;",
"import java.util.Objects;",
"import org.junit.jupiter.params.provider.Arguments;",
Expand Down Expand Up @@ -166,18 +163,13 @@ void replacement() {
" @DateTimeFormat(iso = ISO.DATE_TIME) String dateTime,",
" @DateTimeFormat(iso = ISO.TIME) String time) {}",
"",
" @UseImportPolicy(ImportPolicy.STATIC_IMPORT_ALWAYS)",
" @AfterTemplate",
" void m4() {}",
"",
" @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)",
" final class Test {}",
"}")
.addOutputLines(
"out/A.java",
"import static com.google.common.collect.ImmutableMap.toImmutableMap;",
"import static com.google.common.collect.ImmutableSet.toImmutableSet;",
"import static com.google.errorprone.refaster.ImportPolicy.STATIC_IMPORT_ALWAYS;",
"import static java.nio.charset.StandardCharsets.UTF_8;",
"import static java.util.Objects.requireNonNull;",
"import static java.util.function.Predicate.not;",
Expand All @@ -192,9 +184,6 @@ void replacement() {
"import com.google.common.base.Predicates;",
"import com.google.common.collect.ImmutableMap;",
"import com.google.common.collect.ImmutableSet;",
"import com.google.errorprone.refaster.ImportPolicy;",
"import com.google.errorprone.refaster.annotation.AfterTemplate;",
"import com.google.errorprone.refaster.annotation.UseImportPolicy;",
"import java.nio.charset.StandardCharsets;",
"import java.util.Objects;",
"import org.junit.jupiter.params.provider.Arguments;",
Expand Down Expand Up @@ -238,10 +227,6 @@ void replacement() {
" @DateTimeFormat(iso = DATE_TIME) String dateTime,",
" @DateTimeFormat(iso = TIME) String time) {}",
"",
" @UseImportPolicy(STATIC_IMPORT_ALWAYS)",
" @AfterTemplate",
" void m4() {}",
"",
" @SpringBootTest(webEnvironment = RANDOM_PORT)",
" final class Test {}",
"}")
Expand Down

0 comments on commit 3cf1a2c

Please sign in to comment.