diff --git a/guava-tests/test/com/google/common/collect/FluentIterableTest.java b/guava-tests/test/com/google/common/collect/FluentIterableTest.java index 5a3236cf9a1d..e073bae4f321 100644 --- a/guava-tests/test/com/google/common/collect/FluentIterableTest.java +++ b/guava-tests/test/com/google/common/collect/FluentIterableTest.java @@ -16,7 +16,6 @@ package com.google.common.collect; -import static com.google.common.collect.FluentIterableTest.Help.assertThat; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.truth.Truth.assertThat; import static java.util.Arrays.asList; @@ -31,8 +30,7 @@ import com.google.common.collect.testing.IteratorFeature; import com.google.common.collect.testing.IteratorTester; import com.google.common.testing.NullPointerTester; -import com.google.common.truth.IterableSubject; -import com.google.common.truth.Truth; +import com.google.common.truth.Truth8; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -41,7 +39,6 @@ import java.util.Set; import java.util.SortedSet; import java.util.concurrent.TimeUnit; -import java.util.stream.Stream; import junit.framework.AssertionFailedError; import junit.framework.TestCase; import org.checkerframework.checker.nullness.qual.Nullable; @@ -926,16 +923,9 @@ public void testGet_outOfBounds() { * just test that the toArray() contents are as expected. */ public void testStream() { - assertThat(FluentIterable.of().stream()).isEmpty(); - assertThat(FluentIterable.of("a").stream()).containsExactly("a"); - assertThat(FluentIterable.of(1, 2, 3).stream().filter(n -> n > 1)).containsExactly(2, 3); - } - - // TODO(kevinb): add assertThat(Stream) to Truth? - static class Help { - static IterableSubject assertThat(Stream stream) { - return Truth.assertThat(stream.toArray()).asList(); - } + Truth8.assertThat(FluentIterable.of().stream()).isEmpty(); + Truth8.assertThat(FluentIterable.of("a").stream()).containsExactly("a"); + Truth8.assertThat(FluentIterable.of(1, 2, 3).stream().filter(n -> n > 1)).containsExactly(2, 3); } private static void assertCanIterateAgain(Iterable iterable) { diff --git a/guava-tests/test/com/google/common/collect/MoreCollectorsTest.java b/guava-tests/test/com/google/common/collect/MoreCollectorsTest.java index 65a8971350a2..8c9ea0da7e2d 100644 --- a/guava-tests/test/com/google/common/collect/MoreCollectorsTest.java +++ b/guava-tests/test/com/google/common/collect/MoreCollectorsTest.java @@ -17,9 +17,9 @@ package com.google.common.collect; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import com.google.common.annotations.GwtCompatible; +import com.google.common.truth.Truth8; import java.util.NoSuchElementException; import java.util.stream.Stream; import junit.framework.TestCase; @@ -32,11 +32,11 @@ @GwtCompatible public class MoreCollectorsTest extends TestCase { public void testToOptionalEmpty() { - assertThat(Stream.empty().collect(MoreCollectors.toOptional())).isEmpty(); + Truth8.assertThat(Stream.empty().collect(MoreCollectors.toOptional())).isEmpty(); } public void testToOptionalSingleton() { - assertThat(Stream.of(1).collect(MoreCollectors.toOptional())).hasValue(1); + Truth8.assertThat(Stream.of(1).collect(MoreCollectors.toOptional())).hasValue(1); } public void testToOptionalNull() { diff --git a/guava-tests/test/com/google/common/graph/ValueGraphTest.java b/guava-tests/test/com/google/common/graph/ValueGraphTest.java index 62e596546b7a..95ff63b091b1 100644 --- a/guava-tests/test/com/google/common/graph/ValueGraphTest.java +++ b/guava-tests/test/com/google/common/graph/ValueGraphTest.java @@ -19,11 +19,11 @@ import static com.google.common.graph.GraphConstants.ENDPOINTS_MISMATCH; import static com.google.common.graph.TestUtil.assertStronglyEquivalent; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import static java.util.concurrent.Executors.newFixedThreadPool; import static org.junit.Assert.assertThrows; import com.google.common.collect.ImmutableList; +import com.google.common.truth.Truth8; import java.util.Set; import java.util.concurrent.Callable; import java.util.concurrent.CyclicBarrier; @@ -183,14 +183,14 @@ public void hasEdgeConnecting_undirected_mismatch() { public void edgeValue_directed_correct() { graph = ValueGraphBuilder.directed().build(); graph.putEdgeValue(1, 2, "A"); - assertThat(graph.edgeValue(EndpointPair.ordered(1, 2))).hasValue("A"); + Truth8.assertThat(graph.edgeValue(EndpointPair.ordered(1, 2))).hasValue("A"); } @Test public void edgeValue_directed_backwards() { graph = ValueGraphBuilder.directed().build(); graph.putEdgeValue(1, 2, "A"); - assertThat(graph.edgeValue(EndpointPair.ordered(2, 1))).isEmpty(); + Truth8.assertThat(graph.edgeValue(EndpointPair.ordered(2, 1))).isEmpty(); } @Test @@ -211,14 +211,14 @@ public void edgeValue_directed_mismatch() { public void edgeValue_undirected_correct() { graph = ValueGraphBuilder.undirected().build(); graph.putEdgeValue(1, 2, "A"); - assertThat(graph.edgeValue(EndpointPair.unordered(1, 2))).hasValue("A"); + Truth8.assertThat(graph.edgeValue(EndpointPair.unordered(1, 2))).hasValue("A"); } @Test public void edgeValue_undirected_backwards() { graph = ValueGraphBuilder.undirected().build(); graph.putEdgeValue(1, 2, "A"); - assertThat(graph.edgeValue(EndpointPair.unordered(2, 1))).hasValue("A"); + Truth8.assertThat(graph.edgeValue(EndpointPair.unordered(2, 1))).hasValue("A"); } @Test