aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcpovirk <cpovirk@google.com>2024-01-30 14:10:18 -0800
committerDagger Team <dagger-dev+copybara@google.com>2024-01-30 14:13:02 -0800
commit25f56d2a0246a6b0b1c220bc4abdd2e5e49a92a8 (patch)
tree96157e4e80b561c72b08600cbfc72b029610965a
parent846a64ca8a00aadef501e37c6d0ed2f40b06bca8 (diff)
downloaddagger2-25f56d2a0246a6b0b1c220bc4abdd2e5e49a92a8.tar.gz
Automated Code Change
PiperOrigin-RevId: 602836841
-rw-r--r--javatests/dagger/functional/assisted/AssistedFactoryAsQualifiedBindingTest.java10
-rw-r--r--javatests/dagger/functional/jdk8/OptionalBindingComponentsPresentTest.java4
-rw-r--r--javatests/dagger/functional/producers/aot/ProducesMethodShadowsInjectConstructorTest.java4
-rw-r--r--javatests/dagger/internal/codegen/ComponentProcessorTest.java13
4 files changed, 14 insertions, 17 deletions
diff --git a/javatests/dagger/functional/assisted/AssistedFactoryAsQualifiedBindingTest.java b/javatests/dagger/functional/assisted/AssistedFactoryAsQualifiedBindingTest.java
index 494372a0e..b85342420 100644
--- a/javatests/dagger/functional/assisted/AssistedFactoryAsQualifiedBindingTest.java
+++ b/javatests/dagger/functional/assisted/AssistedFactoryAsQualifiedBindingTest.java
@@ -17,9 +17,9 @@
package dagger.functional.assisted;
import static com.google.common.truth.Truth.assertThat;
-import static com.google.common.truth.Truth8.assertThat;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import com.google.common.truth.Truth8;
import dagger.Binds;
import dagger.BindsInstance;
import dagger.BindsOptionalOf;
@@ -243,10 +243,10 @@ public final class AssistedFactoryAsQualifiedBindingTest {
assertThat(foo.barFactoryAsBinds).isEqualTo(barFactory);
// Test injection of a qualified Bar/BarFactory with custom @BindsOptionalOf implementation
- assertThat(foo.optionalBar).isPresent();
- assertThat(foo.optionalBar).hasValue(bar);
- assertThat(foo.optionalBarFactory).isPresent();
- assertThat(foo.optionalBarFactory).hasValue(barFactory);
+ Truth8.assertThat(foo.optionalBar).isPresent();
+ Truth8.assertThat(foo.optionalBar).hasValue(bar);
+ Truth8.assertThat(foo.optionalBarFactory).isPresent();
+ Truth8.assertThat(foo.optionalBarFactory).hasValue(barFactory);
// Test injection of a qualified Bar/BarFactory as multibinding
assertThat(foo.barSet).containsExactly(bar);
diff --git a/javatests/dagger/functional/jdk8/OptionalBindingComponentsPresentTest.java b/javatests/dagger/functional/jdk8/OptionalBindingComponentsPresentTest.java
index 50fbefe4e..2841c6faf 100644
--- a/javatests/dagger/functional/jdk8/OptionalBindingComponentsPresentTest.java
+++ b/javatests/dagger/functional/jdk8/OptionalBindingComponentsPresentTest.java
@@ -17,11 +17,11 @@
package dagger.functional.jdk8;
import static com.google.common.truth.Truth.assertThat;
-import static com.google.common.truth.Truth8.assertThat;
import static dagger.functional.jdk8.OptionalBindingComponents.Value.QUALIFIED_VALUE;
import static dagger.functional.jdk8.OptionalBindingComponents.Value.VALUE;
import com.google.common.collect.ImmutableList;
+import com.google.common.truth.Truth8;
import dagger.functional.jdk8.OptionalBindingComponents.OptionalBindingComponent;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -64,7 +64,7 @@ public final class OptionalBindingComponentsPresentTest {
@Test
public void qualifiedOptional() {
- assertThat(component.qualifiedValues().optionalInstance()).hasValue(QUALIFIED_VALUE);
+ Truth8.assertThat(component.qualifiedValues().optionalInstance()).hasValue(QUALIFIED_VALUE);
}
@Test
diff --git a/javatests/dagger/functional/producers/aot/ProducesMethodShadowsInjectConstructorTest.java b/javatests/dagger/functional/producers/aot/ProducesMethodShadowsInjectConstructorTest.java
index ef37df216..646454b4e 100644
--- a/javatests/dagger/functional/producers/aot/ProducesMethodShadowsInjectConstructorTest.java
+++ b/javatests/dagger/functional/producers/aot/ProducesMethodShadowsInjectConstructorTest.java
@@ -17,8 +17,8 @@
package dagger.functional.producers.aot;
import static com.google.common.truth.Truth.assertThat;
-import static com.google.common.truth.Truth8.assertThat;
+import com.google.common.truth.Truth8;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import dagger.BindsOptionalOf;
@@ -113,6 +113,6 @@ public class ProducesMethodShadowsInjectConstructorTest {
Leaf leaf = DaggerProducesMethodShadowsInjectConstructorTest_Root.create().leaf();
leaf.dependsOnShadowingProducer().get();
assertThat(leaf.shadowedProvisionMultibinding().get()).hasSize(2);
- assertThat(leaf.emptyProvisionBindingToPresentProductionBinding().get()).isPresent();
+ Truth8.assertThat(leaf.emptyProvisionBindingToPresentProductionBinding().get()).isPresent();
}
}
diff --git a/javatests/dagger/internal/codegen/ComponentProcessorTest.java b/javatests/dagger/internal/codegen/ComponentProcessorTest.java
index a6dc2d6c2..0705d43f7 100644
--- a/javatests/dagger/internal/codegen/ComponentProcessorTest.java
+++ b/javatests/dagger/internal/codegen/ComponentProcessorTest.java
@@ -17,13 +17,13 @@
package dagger.internal.codegen;
import static com.google.common.truth.Truth.assertThat;
-import static com.google.common.truth.Truth8.assertThat;
import static org.junit.Assert.assertThrows;
import androidx.room.compiler.processing.util.CompilationResultSubject;
import androidx.room.compiler.processing.util.Source;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
+import com.google.common.truth.Truth8;
import com.squareup.javapoet.AnnotationSpec;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.TypeSpec;
@@ -1432,13 +1432,10 @@ public class ComponentProcessorTest {
}
private void assertDoesNotHaveNoteContaining(CompilationResultSubject subject, String content) {
- assertThat(
- subject
- .getCompilationResult()
- .getDiagnostics()
- .get(Diagnostic.Kind.NOTE)
- .stream()
- .filter(diagnostic -> diagnostic.getMsg().contains(content))).isEmpty();
+ Truth8.assertThat(
+ subject.getCompilationResult().getDiagnostics().get(Diagnostic.Kind.NOTE).stream()
+ .filter(diagnostic -> diagnostic.getMsg().contains(content)))
+ .isEmpty();
}
@Test