Skip to content

Commit

Permalink
Migrate usages of Truth8.assertThat to equivalent usages of `Truth.…
Browse files Browse the repository at this point in the history
…assertThat`.

The `Truth8` methods will be hidden in the future. All callers will use `Truth`.

PiperOrigin-RevId: 604692296
  • Loading branch information
cpovirk authored and Compile-Testing Team committed Feb 6, 2024
1 parent 293e7d3 commit 997b1b4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/test/java/com/google/testing/compile/CompilationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import static org.junit.Assert.fail;

import com.google.common.collect.ImmutableList;
import com.google.common.truth.Truth8;
import javax.tools.JavaFileObject;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -75,23 +74,21 @@ public void compilerStatusFailure() {
public void generatedFilePath() {
Compiler compiler = compilerWithGenerator();
Compilation compilation = compiler.compile(source1, source2);
Truth8.assertThat(compilation.generatedFile(SOURCE_OUTPUT, "test/generated/Blah.java"))
.isPresent();
assertThat(compilation.generatedFile(SOURCE_OUTPUT, "test/generated/Blah.java")).isPresent();
}

@Test
public void generatedFilePackage() {
Compiler compiler = compilerWithGenerator();
Compilation compilation = compiler.compile(source1, source2);
Truth8.assertThat(compilation.generatedFile(SOURCE_OUTPUT, "test.generated", "Blah.java"))
.isPresent();
assertThat(compilation.generatedFile(SOURCE_OUTPUT, "test.generated", "Blah.java")).isPresent();
}

@Test
public void generatedSourceFile() {
Compiler compiler = compilerWithGenerator();
Compilation compilation = compiler.compile(source1, source2);
Truth8.assertThat(compilation.generatedSourceFile("test.generated.Blah")).isPresent();
assertThat(compilation.generatedSourceFile("test.generated.Blah")).isPresent();
}

private static Compiler compilerWithGenerator() {
Expand Down

0 comments on commit 997b1b4

Please sign in to comment.