diff --git a/javatests/google/registry/model/EntityClassesTest.java b/javatests/google/registry/model/EntityClassesTest.java index 62cd7e61f..7eb1e0282 100644 --- a/javatests/google/registry/model/EntityClassesTest.java +++ b/javatests/google/registry/model/EntityClassesTest.java @@ -16,6 +16,7 @@ package google.registry.model; import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth8.assertThat; import static google.registry.model.EntityClasses.ALL_CLASSES; import static google.registry.util.TypeUtils.hasAnnotation; @@ -45,12 +46,7 @@ public class EntityClassesTest { @Test public void testEntityClasses_baseEntitiesHaveUniqueKinds() throws Exception { - assertThat( - ALL_CLASSES - .stream() - .filter(hasAnnotation(Entity.class)) - .map(Key::getKind) - .collect(toImmutableSet())) + assertThat(ALL_CLASSES.stream().filter(hasAnnotation(Entity.class)).map(Key::getKind)) .named("base entity kinds") .containsNoDuplicates(); } diff --git a/javatests/google/registry/model/registry/RegistryTest.java b/javatests/google/registry/model/registry/RegistryTest.java index b37dd02d3..934f128dd 100644 --- a/javatests/google/registry/model/registry/RegistryTest.java +++ b/javatests/google/registry/model/registry/RegistryTest.java @@ -14,9 +14,9 @@ package google.registry.model.registry; -import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertWithMessage; +import static com.google.common.truth.Truth8.assertThat; import static google.registry.model.common.EntityGroupRoot.getCrossTldKey; import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.testing.DatastoreHelper.createTld; @@ -141,7 +141,7 @@ public class RegistryTest extends EntityTestCase { "mouse,FULLY_BLOCKED"); Registry r = Registry.get("tld") .asBuilder().setReservedLists(ImmutableSet.of(rl5, rl6)).build(); - assertThat(r.getReservedLists().stream().map(Key::getName).collect(toImmutableList())) + assertThat(r.getReservedLists().stream().map(Key::getName)) .containsExactly("tld-reserved5", "tld-reserved6"); r = Registry.get("tld").asBuilder().setReservedLists(ImmutableSet.of()).build(); assertThat(r.getReservedLists()).isEmpty(); @@ -162,7 +162,7 @@ public class RegistryTest extends EntityTestCase { .asBuilder() .setReservedListsByName(ImmutableSet.of("tld-reserved24", "tld-reserved25")) .build(); - assertThat(r.getReservedLists().stream().map(Key::getName).collect(toImmutableList())) + assertThat(r.getReservedLists().stream().map(Key::getName)) .containsExactly("tld-reserved24", "tld-reserved25"); r = Registry.get("tld").asBuilder().setReservedListsByName(ImmutableSet.of()).build(); assertThat(r.getReservedLists()).isEmpty(); diff --git a/javatests/google/registry/testing/TaskQueueHelper.java b/javatests/google/registry/testing/TaskQueueHelper.java index d58a0abd8..bdf21956c 100644 --- a/javatests/google/registry/testing/TaskQueueHelper.java +++ b/javatests/google/registry/testing/TaskQueueHelper.java @@ -18,11 +18,11 @@ import static com.google.appengine.tools.development.testing.LocalTaskQueueTestC import static com.google.common.base.Preconditions.checkState; import static com.google.common.base.Predicates.in; import static com.google.common.base.Predicates.not; -import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.collect.Iterables.getFirst; import static com.google.common.collect.Multisets.containsOccurrences; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assert_; +import static com.google.common.truth.Truth8.assertThat; import static google.registry.util.DiffUtils.prettyPrintEntityDeepDiff; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Arrays.asList; @@ -195,12 +195,7 @@ public class TaskQueueHelper { Function propertyGetter, String... expectedTaskProperties) throws Exception { // Ordering is irrelevant but duplicates should be considered independently. - assertThat( - getQueueInfo(queueName) - .getTaskInfo() - .stream() - .map(propertyGetter) - .collect(toImmutableList())) + assertThat(getQueueInfo(queueName).getTaskInfo().stream().map(propertyGetter)) .containsExactly((Object[]) expectedTaskProperties); } diff --git a/javatests/google/registry/tools/CreateTldCommandTest.java b/javatests/google/registry/tools/CreateTldCommandTest.java index 6592a8194..aca1d2e17 100644 --- a/javatests/google/registry/tools/CreateTldCommandTest.java +++ b/javatests/google/registry/tools/CreateTldCommandTest.java @@ -14,8 +14,8 @@ package google.registry.tools; -import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth8.assertThat; import static google.registry.testing.DatastoreHelper.createTld; import static google.registry.testing.DatastoreHelper.persistPremiumList; import static google.registry.testing.DatastoreHelper.persistReservedList; @@ -283,12 +283,7 @@ public class CreateTldCommandTest extends CommandTestCase { "--roid_suffix=Q9JYB4C", "--dns_writers=VoidDnsWriter", "xn--q9jyb4c"); - assertThat( - Registry.get("xn--q9jyb4c") - .getReservedLists() - .stream() - .map(Key::getName) - .collect(toImmutableList())) + assertThat(Registry.get("xn--q9jyb4c").getReservedLists().stream().map(Key::getName)) .containsExactly("xn--q9jyb4c_abuse", "common_abuse"); } diff --git a/javatests/google/registry/tools/UpdateTldCommandTest.java b/javatests/google/registry/tools/UpdateTldCommandTest.java index 099a831e8..405a317a0 100644 --- a/javatests/google/registry/tools/UpdateTldCommandTest.java +++ b/javatests/google/registry/tools/UpdateTldCommandTest.java @@ -14,8 +14,8 @@ package google.registry.tools; -import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth8.assertThat; import static google.registry.testing.DatastoreHelper.createTld; import static google.registry.testing.DatastoreHelper.persistPremiumList; import static google.registry.testing.DatastoreHelper.persistReservedList; @@ -281,12 +281,7 @@ public class UpdateTldCommandTest extends CommandTestCase { public void testSuccess_setReservedLists() throws Exception { runCommandForced("--reserved_lists=xn--q9jyb4c_r1,xn--q9jyb4c_r2", "xn--q9jyb4c"); - assertThat( - Registry.get("xn--q9jyb4c") - .getReservedLists() - .stream() - .map(Key::getName) - .collect(toImmutableList())) + assertThat(Registry.get("xn--q9jyb4c").getReservedLists().stream().map(Key::getName)) .containsExactly("xn--q9jyb4c_r1", "xn--q9jyb4c_r2"); } @@ -296,12 +291,7 @@ public class UpdateTldCommandTest extends CommandTestCase { .setReservedListsByName(ImmutableSet.of("xn--q9jyb4c_r1", "xn--q9jyb4c_r2")) .build()); runCommandForced("--reserved_lists=xn--q9jyb4c_r2", "xn--q9jyb4c"); - assertThat( - Registry.get("xn--q9jyb4c") - .getReservedLists() - .stream() - .map(Key::getName) - .collect(toImmutableList())) + assertThat(Registry.get("xn--q9jyb4c").getReservedLists().stream().map(Key::getName)) .containsExactly("xn--q9jyb4c_r2"); } @@ -311,12 +301,7 @@ public class UpdateTldCommandTest extends CommandTestCase { .setReservedListsByName(ImmutableSet.of("xn--q9jyb4c_r1")) .build()); runCommandForced("--add_reserved_lists=xn--q9jyb4c_r2", "xn--q9jyb4c"); - assertThat( - Registry.get("xn--q9jyb4c") - .getReservedLists() - .stream() - .map(Key::getName) - .collect(toImmutableList())) + assertThat(Registry.get("xn--q9jyb4c").getReservedLists().stream().map(Key::getName)) .containsExactly("xn--q9jyb4c_r1", "xn--q9jyb4c_r2"); } @@ -335,12 +320,7 @@ public class UpdateTldCommandTest extends CommandTestCase { .setReservedListsByName(ImmutableSet.of("xn--q9jyb4c_r1", "xn--q9jyb4c_r2")) .build()); runCommandForced("--remove_reserved_lists=xn--q9jyb4c_r1", "xn--q9jyb4c"); - assertThat( - Registry.get("xn--q9jyb4c") - .getReservedLists() - .stream() - .map(Key::getName) - .collect(toImmutableList())) + assertThat(Registry.get("xn--q9jyb4c").getReservedLists().stream().map(Key::getName)) .containsExactly("xn--q9jyb4c_r2"); }