diff --git a/extensions/java8/src/test/java/com/google/common/truth/IntStreamSubjectTest.java b/extensions/java8/src/test/java/com/google/common/truth/IntStreamSubjectTest.java index 8e4e82dca..84a0e102e 100644 --- a/extensions/java8/src/test/java/com/google/common/truth/IntStreamSubjectTest.java +++ b/extensions/java8/src/test/java/com/google/common/truth/IntStreamSubjectTest.java @@ -18,6 +18,7 @@ import static com.google.common.truth.FailureAssertions.assertFailureKeys; import static com.google.common.truth.FailureAssertions.assertFailureValue; import static com.google.common.truth.IntStreamSubject.intStreams; +import static com.google.common.truth.Truth.assertThat; import static java.util.Arrays.asList; import static org.junit.Assert.fail; @@ -39,7 +40,7 @@ public final class IntStreamSubjectTest { @SuppressWarnings("TruthSelfEquals") public void testIsEqualTo() throws Exception { IntStream stream = IntStream.of(42); - Truth8.assertThat(stream).isEqualTo(stream); + assertThat(stream).isEqualTo(stream); } @Test @@ -53,7 +54,7 @@ public void testIsEqualToList() throws Exception { public void testNullStream_fails() throws Exception { IntStream nullStream = null; try { - Truth8.assertThat(nullStream).isEmpty(); + assertThat(nullStream).isEmpty(); fail(); } catch (NullPointerException expected) { } @@ -62,19 +63,19 @@ public void testNullStream_fails() throws Exception { @Test public void testNullStreamIsNull() throws Exception { IntStream nullStream = null; - Truth8.assertThat(nullStream).isNull(); + assertThat(nullStream).isNull(); } @Test @SuppressWarnings("TruthSelfEquals") public void testIsSameInstanceAs() throws Exception { IntStream stream = IntStream.of(1); - Truth8.assertThat(stream).isSameInstanceAs(stream); + assertThat(stream).isSameInstanceAs(stream); } @Test public void testIsEmpty() throws Exception { - Truth8.assertThat(IntStream.of()).isEmpty(); + assertThat(IntStream.of()).isEmpty(); } @Test @@ -85,7 +86,7 @@ public void testIsEmpty_fails() throws Exception { @Test public void testIsNotEmpty() throws Exception { - Truth8.assertThat(IntStream.of(42)).isNotEmpty(); + assertThat(IntStream.of(42)).isNotEmpty(); } @Test @@ -96,7 +97,7 @@ public void testIsNotEmpty_fails() throws Exception { @Test public void testHasSize() throws Exception { - Truth8.assertThat(IntStream.of(42)).hasSize(1); + assertThat(IntStream.of(42)).hasSize(1); } @Test @@ -107,7 +108,7 @@ public void testHasSize_fails() throws Exception { @Test public void testContainsNoDuplicates() throws Exception { - Truth8.assertThat(IntStream.of(42)).containsNoDuplicates(); + assertThat(IntStream.of(42)).containsNoDuplicates(); } @Test @@ -118,7 +119,7 @@ public void testContainsNoDuplicates_fails() throws Exception { @Test public void testContains() throws Exception { - Truth8.assertThat(IntStream.of(42)).contains(42); + assertThat(IntStream.of(42)).contains(42); } @Test @@ -129,7 +130,7 @@ public void testContains_fails() throws Exception { @Test public void testContainsAnyOf() throws Exception { - Truth8.assertThat(IntStream.of(42)).containsAnyOf(42, 43); + assertThat(IntStream.of(42)).containsAnyOf(42, 43); } @Test @@ -140,7 +141,7 @@ public void testContainsAnyOf_fails() throws Exception { @Test public void testContainsAnyIn() throws Exception { - Truth8.assertThat(IntStream.of(42)).containsAnyIn(asList(42, 43)); + assertThat(IntStream.of(42)).containsAnyIn(asList(42, 43)); } @Test @@ -152,7 +153,7 @@ public void testContainsAnyIn_fails() throws Exception { @Test public void testDoesNotContain() throws Exception { - Truth8.assertThat(IntStream.of(42)).doesNotContain(43); + assertThat(IntStream.of(42)).doesNotContain(43); } @Test @@ -163,7 +164,7 @@ public void testDoesNotContain_fails() throws Exception { @Test public void testContainsNoneOf() throws Exception { - Truth8.assertThat(IntStream.of(42)).containsNoneOf(43, 44); + assertThat(IntStream.of(42)).containsNoneOf(43, 44); } @Test @@ -174,7 +175,7 @@ public void testContainsNoneOf_fails() throws Exception { @Test public void testContainsNoneIn() throws Exception { - Truth8.assertThat(IntStream.of(42)).containsNoneIn(asList(43, 44)); + assertThat(IntStream.of(42)).containsNoneIn(asList(43, 44)); } @Test @@ -186,7 +187,7 @@ public void testContainsNoneIn_fails() throws Exception { @Test public void testContainsAtLeast() throws Exception { - Truth8.assertThat(IntStream.of(42, 43)).containsAtLeast(42, 43); + assertThat(IntStream.of(42, 43)).containsAtLeast(42, 43); } @Test @@ -198,7 +199,7 @@ public void testContainsAtLeast_fails() throws Exception { @Test public void testContainsAtLeast_inOrder() throws Exception { - Truth8.assertThat(IntStream.of(42, 43)).containsAtLeast(42, 43).inOrder(); + assertThat(IntStream.of(42, 43)).containsAtLeast(42, 43).inOrder(); } @Test @@ -217,7 +218,7 @@ public void testContainsAtLeast_inOrder_fails() throws Exception { @Test public void testContainsAtLeastElementsIn() throws Exception { - Truth8.assertThat(IntStream.of(42, 43)).containsAtLeastElementsIn(asList(42, 43)); + assertThat(IntStream.of(42, 43)).containsAtLeastElementsIn(asList(42, 43)); } @Test @@ -232,7 +233,7 @@ public void testContainsAtLeastElementsIn_fails() throws Exception { @Test public void testContainsAtLeastElementsIn_inOrder() throws Exception { - Truth8.assertThat(IntStream.of(42, 43)).containsAtLeastElementsIn(asList(42, 43)).inOrder(); + assertThat(IntStream.of(42, 43)).containsAtLeastElementsIn(asList(42, 43)).inOrder(); } @Test @@ -254,7 +255,7 @@ public void testContainsAtLeastElementsIn_inOrder_fails() throws Exception { @Test public void testContainsExactly() throws Exception { - Truth8.assertThat(IntStream.of(42, 43)).containsExactly(42, 43); + assertThat(IntStream.of(42, 43)).containsExactly(42, 43); } @Test @@ -267,7 +268,7 @@ public void testContainsExactly_fails() throws Exception { @Test public void testContainsExactly_inOrder() throws Exception { - Truth8.assertThat(IntStream.of(42, 43)).containsExactly(42, 43).inOrder(); + assertThat(IntStream.of(42, 43)).containsExactly(42, 43).inOrder(); } @Test @@ -282,8 +283,8 @@ public void testContainsExactly_inOrder_fails() throws Exception { @Test public void testContainsExactlyElementsIn() throws Exception { - Truth8.assertThat(IntStream.of(42, 43)).containsExactlyElementsIn(asList(42, 43)); - Truth8.assertThat(IntStream.of(42, 43)).containsExactlyElementsIn(asList(43, 42)); + assertThat(IntStream.of(42, 43)).containsExactlyElementsIn(asList(42, 43)); + assertThat(IntStream.of(42, 43)).containsExactlyElementsIn(asList(43, 42)); } @Test @@ -298,7 +299,7 @@ public void testContainsExactlyElementsIn_fails() throws Exception { @Test public void testContainsExactlyElementsIn_inOrder() throws Exception { - Truth8.assertThat(IntStream.of(42, 43)).containsExactlyElementsIn(asList(42, 43)).inOrder(); + assertThat(IntStream.of(42, 43)).containsExactlyElementsIn(asList(42, 43)).inOrder(); } @Test @@ -316,14 +317,14 @@ public void testContainsExactlyElementsIn_inOrder_fails() throws Exception { @Test public void testContainsExactlyElementsIn_inOrder_intStream() throws Exception { - Truth8.assertThat(IntStream.of(1, 2, 3, 4)).containsExactly(1, 2, 3, 4).inOrder(); + assertThat(IntStream.of(1, 2, 3, 4)).containsExactly(1, 2, 3, 4).inOrder(); } @Test public void testIsInOrder() { - Truth8.assertThat(IntStream.of()).isInOrder(); - Truth8.assertThat(IntStream.of(1)).isInOrder(); - Truth8.assertThat(IntStream.of(1, 1, 2, 3, 3, 3, 4)).isInOrder(); + assertThat(IntStream.of()).isInOrder(); + assertThat(IntStream.of(1)).isInOrder(); + assertThat(IntStream.of(1, 1, 2, 3, 3, 3, 4)).isInOrder(); } @Test @@ -334,9 +335,9 @@ public void testIsInOrder_fails() { @Test public void testIsInStrictOrder() { - Truth8.assertThat(IntStream.of()).isInStrictOrder(); - Truth8.assertThat(IntStream.of(1)).isInStrictOrder(); - Truth8.assertThat(IntStream.of(1, 2, 3, 4)).isInStrictOrder(); + assertThat(IntStream.of()).isInStrictOrder(); + assertThat(IntStream.of(1)).isInStrictOrder(); + assertThat(IntStream.of(1, 2, 3, 4)).isInStrictOrder(); } @Test diff --git a/extensions/java8/src/test/java/com/google/common/truth/LongStreamSubjectTest.java b/extensions/java8/src/test/java/com/google/common/truth/LongStreamSubjectTest.java index 8c0f4eb0c..41026046d 100644 --- a/extensions/java8/src/test/java/com/google/common/truth/LongStreamSubjectTest.java +++ b/extensions/java8/src/test/java/com/google/common/truth/LongStreamSubjectTest.java @@ -18,6 +18,7 @@ import static com.google.common.truth.FailureAssertions.assertFailureKeys; import static com.google.common.truth.FailureAssertions.assertFailureValue; import static com.google.common.truth.LongStreamSubject.longStreams; +import static com.google.common.truth.Truth.assertThat; import static java.util.Arrays.asList; import static org.junit.Assert.fail; @@ -39,7 +40,7 @@ public final class LongStreamSubjectTest { @SuppressWarnings("TruthSelfEquals") public void testIsEqualTo() throws Exception { LongStream stream = LongStream.of(42); - Truth8.assertThat(stream).isEqualTo(stream); + assertThat(stream).isEqualTo(stream); } @Test @@ -53,7 +54,7 @@ public void testIsEqualToList() throws Exception { public void testNullStream_fails() throws Exception { LongStream nullStream = null; try { - Truth8.assertThat(nullStream).isEmpty(); + assertThat(nullStream).isEmpty(); fail(); } catch (NullPointerException expected) { } @@ -62,19 +63,19 @@ public void testNullStream_fails() throws Exception { @Test public void testNullStreamIsNull() throws Exception { LongStream nullStream = null; - Truth8.assertThat(nullStream).isNull(); + assertThat(nullStream).isNull(); } @Test @SuppressWarnings("TruthSelfEquals") public void testIsSameInstanceAs() throws Exception { LongStream stream = LongStream.of(1); - Truth8.assertThat(stream).isSameInstanceAs(stream); + assertThat(stream).isSameInstanceAs(stream); } @Test public void testIsEmpty() throws Exception { - Truth8.assertThat(LongStream.of()).isEmpty(); + assertThat(LongStream.of()).isEmpty(); } @Test @@ -85,7 +86,7 @@ public void testIsEmpty_fails() throws Exception { @Test public void testIsNotEmpty() throws Exception { - Truth8.assertThat(LongStream.of(42)).isNotEmpty(); + assertThat(LongStream.of(42)).isNotEmpty(); } @Test @@ -96,7 +97,7 @@ public void testIsNotEmpty_fails() throws Exception { @Test public void testHasSize() throws Exception { - Truth8.assertThat(LongStream.of(42)).hasSize(1); + assertThat(LongStream.of(42)).hasSize(1); } @Test @@ -107,7 +108,7 @@ public void testHasSize_fails() throws Exception { @Test public void testContainsNoDuplicates() throws Exception { - Truth8.assertThat(LongStream.of(42)).containsNoDuplicates(); + assertThat(LongStream.of(42)).containsNoDuplicates(); } @Test @@ -119,7 +120,7 @@ public void testContainsNoDuplicates_fails() throws Exception { @Test public void testContains() throws Exception { - Truth8.assertThat(LongStream.of(42)).contains(42); + assertThat(LongStream.of(42)).contains(42); } @Test @@ -130,7 +131,7 @@ public void testContains_fails() throws Exception { @Test public void testContainsAnyOf() throws Exception { - Truth8.assertThat(LongStream.of(42)).containsAnyOf(42, 43); + assertThat(LongStream.of(42)).containsAnyOf(42, 43); } @Test @@ -141,7 +142,7 @@ public void testContainsAnyOf_fails() throws Exception { @Test public void testContainsAnyIn() throws Exception { - Truth8.assertThat(LongStream.of(42)).containsAnyIn(asList(42L, 43L)); + assertThat(LongStream.of(42)).containsAnyIn(asList(42L, 43L)); } @Test @@ -153,7 +154,7 @@ public void testContainsAnyIn_fails() throws Exception { @Test public void testDoesNotContain() throws Exception { - Truth8.assertThat(LongStream.of(42)).doesNotContain(43); + assertThat(LongStream.of(42)).doesNotContain(43); } @Test @@ -164,7 +165,7 @@ public void testDoesNotContain_fails() throws Exception { @Test public void testContainsNoneOf() throws Exception { - Truth8.assertThat(LongStream.of(42)).containsNoneOf(43, 44); + assertThat(LongStream.of(42)).containsNoneOf(43, 44); } @Test @@ -175,7 +176,7 @@ public void testContainsNoneOf_fails() throws Exception { @Test public void testContainsNoneIn() throws Exception { - Truth8.assertThat(LongStream.of(42)).containsNoneIn(asList(43, 44)); + assertThat(LongStream.of(42)).containsNoneIn(asList(43, 44)); } @Test @@ -187,7 +188,7 @@ public void testContainsNoneIn_fails() throws Exception { @Test public void testContainsAtLeast() throws Exception { - Truth8.assertThat(LongStream.of(42, 43)).containsAtLeast(42, 43); + assertThat(LongStream.of(42, 43)).containsAtLeast(42, 43); } @Test @@ -199,7 +200,7 @@ public void testContainsAtLeast_fails() throws Exception { @Test public void testContainsAtLeast_inOrder() throws Exception { - Truth8.assertThat(LongStream.of(42, 43)).containsAtLeast(42, 43).inOrder(); + assertThat(LongStream.of(42, 43)).containsAtLeast(42, 43).inOrder(); } @Test @@ -218,7 +219,7 @@ public void testContainsAtLeast_inOrder_fails() throws Exception { @Test public void testContainsAtLeastElementsIn() throws Exception { - Truth8.assertThat(LongStream.of(42, 43)).containsAtLeastElementsIn(asList(42L, 43L)); + assertThat(LongStream.of(42, 43)).containsAtLeastElementsIn(asList(42L, 43L)); } @Test @@ -243,7 +244,7 @@ public void testContainsAtLeastElementsIn_wrongType_fails() throws Exception { @Test public void testContainsAtLeastElementsIn_inOrder() throws Exception { - Truth8.assertThat(LongStream.of(42, 43)).containsAtLeastElementsIn(asList(42L, 43L)).inOrder(); + assertThat(LongStream.of(42, 43)).containsAtLeastElementsIn(asList(42L, 43L)).inOrder(); } @Test @@ -276,7 +277,7 @@ public void testContainsAtLeastElementsIn_inOrder_wrongType_fails() throws Excep @Test public void testContainsExactly() throws Exception { - Truth8.assertThat(LongStream.of(42, 43)).containsExactly(42, 43); + assertThat(LongStream.of(42, 43)).containsExactly(42, 43); } @Test @@ -289,7 +290,7 @@ public void testContainsExactly_fails() throws Exception { @Test public void testContainsExactly_inOrder() throws Exception { - Truth8.assertThat(LongStream.of(42, 43)).containsExactly(42, 43).inOrder(); + assertThat(LongStream.of(42, 43)).containsExactly(42, 43).inOrder(); } @Test @@ -304,8 +305,8 @@ public void testContainsExactly_inOrder_fails() throws Exception { @Test public void testContainsExactlyElementsIn() throws Exception { - Truth8.assertThat(LongStream.of(42, 43)).containsExactlyElementsIn(asList(42L, 43L)); - Truth8.assertThat(LongStream.of(42, 43)).containsExactlyElementsIn(asList(43L, 42L)); + assertThat(LongStream.of(42, 43)).containsExactlyElementsIn(asList(42L, 43L)); + assertThat(LongStream.of(42, 43)).containsExactlyElementsIn(asList(43L, 42L)); } @Test @@ -328,7 +329,7 @@ public void testContainsExactlyElementsIn_wrongType_fails() throws Exception { @Test public void testContainsExactlyElementsIn_inOrder() throws Exception { - Truth8.assertThat(LongStream.of(42, 43)).containsExactlyElementsIn(asList(42L, 43L)).inOrder(); + assertThat(LongStream.of(42, 43)).containsExactlyElementsIn(asList(42L, 43L)).inOrder(); } @Test @@ -357,14 +358,14 @@ public void testContainsExactlyElementsIn_inOrder_wrongType_fails() throws Excep @Test public void testContainsExactlyElementsIn_inOrder_LongStream() throws Exception { - Truth8.assertThat(LongStream.of(1, 2, 3, 4)).containsExactly(1, 2, 3, 4).inOrder(); + assertThat(LongStream.of(1, 2, 3, 4)).containsExactly(1, 2, 3, 4).inOrder(); } @Test public void testIsInOrder() { - Truth8.assertThat(LongStream.of()).isInOrder(); - Truth8.assertThat(LongStream.of(1)).isInOrder(); - Truth8.assertThat(LongStream.of(1, 1, 2, 3, 3, 3, 4)).isInOrder(); + assertThat(LongStream.of()).isInOrder(); + assertThat(LongStream.of(1)).isInOrder(); + assertThat(LongStream.of(1, 1, 2, 3, 3, 3, 4)).isInOrder(); } @Test @@ -375,9 +376,9 @@ public void testIsInOrder_fails() { @Test public void testIsInStrictOrder() { - Truth8.assertThat(LongStream.of()).isInStrictOrder(); - Truth8.assertThat(LongStream.of(1)).isInStrictOrder(); - Truth8.assertThat(LongStream.of(1, 2, 3, 4)).isInStrictOrder(); + assertThat(LongStream.of()).isInStrictOrder(); + assertThat(LongStream.of(1)).isInStrictOrder(); + assertThat(LongStream.of(1, 2, 3, 4)).isInStrictOrder(); } @Test diff --git a/extensions/java8/src/test/java/com/google/common/truth/OptionalDoubleSubjectTest.java b/extensions/java8/src/test/java/com/google/common/truth/OptionalDoubleSubjectTest.java index 1b9cfefde..481547799 100644 --- a/extensions/java8/src/test/java/com/google/common/truth/OptionalDoubleSubjectTest.java +++ b/extensions/java8/src/test/java/com/google/common/truth/OptionalDoubleSubjectTest.java @@ -40,7 +40,7 @@ public void failOnNullSubject() { @Test public void isPresent() { - Truth8.assertThat(OptionalDouble.of(1337.0)).isPresent(); + assertThat(OptionalDouble.of(1337.0)).isPresent(); } @Test @@ -52,7 +52,7 @@ public void isPresentFailing() { @Test public void isEmpty() { - Truth8.assertThat(OptionalDouble.empty()).isEmpty(); + assertThat(OptionalDouble.empty()).isEmpty(); } @Test @@ -71,7 +71,7 @@ public void isEmptyFailingNull() { @Test public void hasValue() { - Truth8.assertThat(OptionalDouble.of(1337.0)).hasValue(1337.0); + assertThat(OptionalDouble.of(1337.0)).hasValue(1337.0); } @Test diff --git a/extensions/java8/src/test/java/com/google/common/truth/OptionalIntSubjectTest.java b/extensions/java8/src/test/java/com/google/common/truth/OptionalIntSubjectTest.java index c7f2d3561..53b2c7831 100644 --- a/extensions/java8/src/test/java/com/google/common/truth/OptionalIntSubjectTest.java +++ b/extensions/java8/src/test/java/com/google/common/truth/OptionalIntSubjectTest.java @@ -40,7 +40,7 @@ public void failOnNullSubject() { @Test public void isPresent() { - Truth8.assertThat(OptionalInt.of(1337)).isPresent(); + assertThat(OptionalInt.of(1337)).isPresent(); } @Test @@ -52,7 +52,7 @@ public void isPresentFailing() { @Test public void isEmpty() { - Truth8.assertThat(OptionalInt.empty()).isEmpty(); + assertThat(OptionalInt.empty()).isEmpty(); } @Test @@ -71,7 +71,7 @@ public void isEmptyFailingNull() { @Test public void hasValue() { - Truth8.assertThat(OptionalInt.of(1337)).hasValue(1337); + assertThat(OptionalInt.of(1337)).hasValue(1337); } @Test diff --git a/extensions/java8/src/test/java/com/google/common/truth/OptionalLongSubjectTest.java b/extensions/java8/src/test/java/com/google/common/truth/OptionalLongSubjectTest.java index 6b4202f9c..dc3678892 100644 --- a/extensions/java8/src/test/java/com/google/common/truth/OptionalLongSubjectTest.java +++ b/extensions/java8/src/test/java/com/google/common/truth/OptionalLongSubjectTest.java @@ -40,7 +40,7 @@ public void failOnNullSubject() { @Test public void isPresent() { - Truth8.assertThat(OptionalLong.of(1337L)).isPresent(); + assertThat(OptionalLong.of(1337L)).isPresent(); } @Test @@ -52,7 +52,7 @@ public void isPresentFailing() { @Test public void isEmpty() { - Truth8.assertThat(OptionalLong.empty()).isEmpty(); + assertThat(OptionalLong.empty()).isEmpty(); } @Test @@ -71,7 +71,7 @@ public void isEmptyFailingNull() { @Test public void hasValue() { - Truth8.assertThat(OptionalLong.of(1337L)).hasValue(1337L); + assertThat(OptionalLong.of(1337L)).hasValue(1337L); } @Test diff --git a/extensions/java8/src/test/java/com/google/common/truth/OptionalSubjectTest.java b/extensions/java8/src/test/java/com/google/common/truth/OptionalSubjectTest.java index 9a05d8b00..757af0bd6 100644 --- a/extensions/java8/src/test/java/com/google/common/truth/OptionalSubjectTest.java +++ b/extensions/java8/src/test/java/com/google/common/truth/OptionalSubjectTest.java @@ -35,7 +35,7 @@ public class OptionalSubjectTest { @Test public void isPresent() { - Truth8.assertThat(Optional.of("foo")).isPresent(); + assertThat(Optional.of("foo")).isPresent(); } @Test @@ -56,7 +56,7 @@ public void isPresentFailingNull() { @Test public void isEmpty() { - Truth8.assertThat(Optional.empty()).isEmpty(); + assertThat(Optional.empty()).isEmpty(); } @Test @@ -75,7 +75,7 @@ public void isEmptyFailingNull() { @Test public void hasValue() { - Truth8.assertThat(Optional.of("foo")).hasValue("foo"); + assertThat(Optional.of("foo")).hasValue("foo"); } @Test @@ -92,7 +92,7 @@ public void hasValue_failingWithEmpty() { @Test public void hasValue_npeWithNullParameter() { try { - Truth8.assertThat(Optional.of("foo")).hasValue(null); + assertThat(Optional.of("foo")).hasValue(null); fail("Expected NPE"); } catch (NullPointerException expected) { assertThat(expected).hasMessageThat().isEqualTo("Optional cannot have a null value."); diff --git a/extensions/java8/src/test/java/com/google/common/truth/PathSubjectTest.java b/extensions/java8/src/test/java/com/google/common/truth/PathSubjectTest.java index 1e97f4d05..801dfd0cf 100644 --- a/extensions/java8/src/test/java/com/google/common/truth/PathSubjectTest.java +++ b/extensions/java8/src/test/java/com/google/common/truth/PathSubjectTest.java @@ -15,7 +15,7 @@ */ package com.google.common.truth; -import static com.google.common.truth.Truth8.assertThat; +import static com.google.common.truth.Truth.assertThat; import java.nio.file.Paths; import org.junit.Test;