Skip to content

Commit 3ff139f

Browse files
cpovirkError Prone Team
authored and
Error Prone Team
committed
Automatic code cleanup.
PiperOrigin-RevId: 605025464
1 parent 0bd7432 commit 3ff139f

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

check_api/src/test/java/com/google/errorprone/ErrorProneFlagsTest.java

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import com.google.common.collect.ImmutableMap;
2323
import com.google.common.collect.ImmutableSet;
24-
import com.google.common.truth.Truth8;
2524
import org.junit.Test;
2625
import org.junit.runner.RunWith;
2726
import org.junit.runners.JUnit4;
@@ -38,10 +37,10 @@ public void parseAndGetStringValue() {
3837
.parseFlag("-XepOpt:Other:Arg:More:Parts=Long")
3938
.parseFlag("-XepOpt:EmptyArg=")
4039
.build();
41-
Truth8.assertThat(flags.get("SomeArg")).hasValue("SomeValue");
42-
Truth8.assertThat(flags.get("Other:Arg:More:Parts")).hasValue("Long");
43-
Truth8.assertThat(flags.get("EmptyArg")).hasValue("");
44-
Truth8.assertThat(flags.get("absent")).isEmpty();
40+
assertThat(flags.get("SomeArg")).hasValue("SomeValue");
41+
assertThat(flags.get("Other:Arg:More:Parts")).hasValue("Long");
42+
assertThat(flags.get("EmptyArg")).hasValue("");
43+
assertThat(flags.get("absent")).isEmpty();
4544
}
4645

4746
@Test
@@ -54,17 +53,17 @@ public void parseAndGetBoolean() {
5453
.parseFlag("-XepOpt:Arg3=yes")
5554
.parseFlag("-XepOpt:Arg4")
5655
.build();
57-
Truth8.assertThat(flags.getBoolean("Arg1")).hasValue(true);
58-
Truth8.assertThat(flags.getBoolean("Arg2")).hasValue(false);
56+
assertThat(flags.getBoolean("Arg1")).hasValue(true);
57+
assertThat(flags.getBoolean("Arg2")).hasValue(false);
5958
assertThrows(IllegalArgumentException.class, () -> flags.getBoolean("Arg3"));
60-
Truth8.assertThat(flags.getBoolean("Arg4")).hasValue(true);
61-
Truth8.assertThat(flags.getBoolean("absent")).isEmpty();
59+
assertThat(flags.getBoolean("Arg4")).hasValue(true);
60+
assertThat(flags.getBoolean("absent")).isEmpty();
6261
}
6362

6463
@Test
6564
public void parseAndGetImplicitTrue() {
6665
ErrorProneFlags flags = ErrorProneFlags.builder().parseFlag("-XepOpt:SomeArg").build();
67-
Truth8.assertThat(flags.getBoolean("SomeArg")).hasValue(true);
66+
assertThat(flags.getBoolean("SomeArg")).hasValue(true);
6867
}
6968

7069
@Test
@@ -75,10 +74,10 @@ public void parseAndGetInteger() {
7574
.parseFlag("-XepOpt:Arg2=20.6")
7675
.parseFlag("-XepOpt:Arg3=thirty")
7776
.build();
78-
Truth8.assertThat(flags.getInteger("Arg1")).hasValue(10);
77+
assertThat(flags.getInteger("Arg1")).hasValue(10);
7978
assertThrows(NumberFormatException.class, () -> flags.getInteger("Arg2"));
8079
assertThrows(NumberFormatException.class, () -> flags.getInteger("Arg3"));
81-
Truth8.assertThat(flags.getInteger("absent")).isEmpty();
80+
assertThat(flags.getInteger("absent")).isEmpty();
8281
}
8382

8483
@Test
@@ -145,13 +144,13 @@ public void enumFlags() {
145144
.parseFlag("-XepOpt:CaseInsensitiveColours=yellow,green")
146145
.parseFlag("-XepOpt:EmptyColours=")
147146
.build();
148-
Truth8.assertThat(flags.getEnum("Colour", Colour.class)).hasValue(Colour.RED);
149-
Truth8.assertThat(flags.getEnumSet("Colours", Colour.class))
147+
assertThat(flags.getEnum("Colour", Colour.class)).hasValue(Colour.RED);
148+
assertThat(flags.getEnumSet("Colours", Colour.class))
150149
.hasValue(ImmutableSet.of(Colour.YELLOW, Colour.GREEN));
151-
Truth8.assertThat(flags.getEnumSet("CaseInsensitiveColours", Colour.class))
150+
assertThat(flags.getEnumSet("CaseInsensitiveColours", Colour.class))
152151
.hasValue(ImmutableSet.of(Colour.YELLOW, Colour.GREEN));
153-
Truth8.assertThat(flags.getEnumSet("EmptyColours", Colour.class)).hasValue(ImmutableSet.of());
154-
Truth8.assertThat(flags.getEnumSet("NoSuchColours", Colour.class)).isEmpty();
152+
assertThat(flags.getEnumSet("EmptyColours", Colour.class)).hasValue(ImmutableSet.of());
153+
assertThat(flags.getEnumSet("NoSuchColours", Colour.class)).isEmpty();
155154
}
156155

157156
@Test

core/src/test/java/com/google/errorprone/scanner/ScannerSupplierTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import com.google.common.truth.FailureMetadata;
3131
import com.google.common.truth.MapSubject;
3232
import com.google.common.truth.Subject;
33-
import com.google.common.truth.Truth8;
3433
import com.google.errorprone.BugCheckerInfo;
3534
import com.google.errorprone.BugPattern;
3635
import com.google.errorprone.BugPattern.SeverityLevel;
@@ -149,7 +148,7 @@ public void plusAllowsDuplicateClassLoading() throws Exception {
149148
assertThat(class1).isNotEqualTo(class2);
150149
ScannerSupplier ss = ss1.plus(ss2);
151150
assertThat(ss.getAllChecks()).hasSize(2);
152-
Truth8.assertThat(ss.getAllChecks().values().stream().map(c -> c.checkerClass()))
151+
assertThat(ss.getAllChecks().values().stream().map(c -> c.checkerClass()))
153152
.containsExactly(ArrayEquals.class, class1);
154153
assertScanner(ss).hasEnabledChecks(class1);
155154
}

0 commit comments

Comments
 (0)