Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 603080567
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Jan 31, 2024
1 parent 7c65fc6 commit 0999369
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import static com.google.common.truth.ExpectFailure.assertThat;
import static com.google.common.truth.OptionalDoubleSubject.optionalDoubles;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth8.assertThat;

import java.util.OptionalDouble;
import org.junit.Test;
Expand All @@ -41,7 +40,7 @@ public void failOnNullSubject() {

@Test
public void isPresent() {
assertThat(OptionalDouble.of(1337.0)).isPresent();
Truth8.assertThat(OptionalDouble.of(1337.0)).isPresent();
}

@Test
Expand All @@ -53,7 +52,7 @@ public void isPresentFailing() {

@Test
public void isEmpty() {
assertThat(OptionalDouble.empty()).isEmpty();
Truth8.assertThat(OptionalDouble.empty()).isEmpty();
}

@Test
Expand All @@ -72,7 +71,7 @@ public void isEmptyFailingNull() {

@Test
public void hasValue() {
assertThat(OptionalDouble.of(1337.0)).hasValue(1337.0);
Truth8.assertThat(OptionalDouble.of(1337.0)).hasValue(1337.0);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import static com.google.common.truth.ExpectFailure.assertThat;
import static com.google.common.truth.OptionalIntSubject.optionalInts;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth8.assertThat;

import java.util.OptionalInt;
import org.junit.Test;
Expand All @@ -41,7 +40,7 @@ public void failOnNullSubject() {

@Test
public void isPresent() {
assertThat(OptionalInt.of(1337)).isPresent();
Truth8.assertThat(OptionalInt.of(1337)).isPresent();
}

@Test
Expand All @@ -53,7 +52,7 @@ public void isPresentFailing() {

@Test
public void isEmpty() {
assertThat(OptionalInt.empty()).isEmpty();
Truth8.assertThat(OptionalInt.empty()).isEmpty();
}

@Test
Expand All @@ -72,7 +71,7 @@ public void isEmptyFailingNull() {

@Test
public void hasValue() {
assertThat(OptionalInt.of(1337)).hasValue(1337);
Truth8.assertThat(OptionalInt.of(1337)).hasValue(1337);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import static com.google.common.truth.ExpectFailure.assertThat;
import static com.google.common.truth.OptionalLongSubject.optionalLongs;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth8.assertThat;

import java.util.OptionalLong;
import org.junit.Test;
Expand All @@ -41,7 +40,7 @@ public void failOnNullSubject() {

@Test
public void isPresent() {
assertThat(OptionalLong.of(1337L)).isPresent();
Truth8.assertThat(OptionalLong.of(1337L)).isPresent();
}

@Test
Expand All @@ -53,7 +52,7 @@ public void isPresentFailing() {

@Test
public void isEmpty() {
assertThat(OptionalLong.empty()).isEmpty();
Truth8.assertThat(OptionalLong.empty()).isEmpty();
}

@Test
Expand All @@ -72,7 +71,7 @@ public void isEmptyFailingNull() {

@Test
public void hasValue() {
assertThat(OptionalLong.of(1337L)).hasValue(1337L);
Truth8.assertThat(OptionalLong.of(1337L)).hasValue(1337L);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import static com.google.common.truth.ExpectFailure.assertThat;
import static com.google.common.truth.OptionalSubject.optionals;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth8.assertThat;
import static org.junit.Assert.fail;

import java.util.Optional;
Expand All @@ -36,7 +35,7 @@ public class OptionalSubjectTest {

@Test
public void isPresent() {
assertThat(Optional.of("foo")).isPresent();
Truth8.assertThat(Optional.of("foo")).isPresent();
}

@Test
Expand All @@ -57,7 +56,7 @@ public void isPresentFailingNull() {

@Test
public void isEmpty() {
assertThat(Optional.empty()).isEmpty();
Truth8.assertThat(Optional.empty()).isEmpty();
}

@Test
Expand All @@ -76,7 +75,7 @@ public void isEmptyFailingNull() {

@Test
public void hasValue() {
assertThat(Optional.of("foo")).hasValue("foo");
Truth8.assertThat(Optional.of("foo")).hasValue("foo");
}

@Test
Expand All @@ -93,7 +92,7 @@ public void hasValue_failingWithEmpty() {
@Test
public void hasValue_npeWithNullParameter() {
try {
assertThat(Optional.of("foo")).hasValue(null);
Truth8.assertThat(Optional.of("foo")).hasValue(null);
fail("Expected NPE");
} catch (NullPointerException expected) {
assertThat(expected).hasMessageThat().isEqualTo("Optional cannot have a null value.");
Expand Down

0 comments on commit 0999369

Please sign in to comment.