From 7763d3f292c9b729a9f13d33e3299a0a19c16aeb Mon Sep 17 00:00:00 2001 From: Michael Muller Date: Thu, 27 May 2021 10:39:15 -0400 Subject: [PATCH] Remove labels from output of list_premium_lists (#1182) * Remove labels from output of list_premium_lists Remove the ability to show all of the labels associated with a premium list in the list_premium_lists command. Supporting this requires loading the entire contents of all premium lists from the database as opposed to just the list records, and the information can be obtained using get_premium_list. --- .../tools/server/ListPremiumListsAction.java | 11 ----------- .../tools/server/ListPremiumListsActionTest.java | 13 ------------- 2 files changed, 24 deletions(-) diff --git a/core/src/main/java/google/registry/tools/server/ListPremiumListsAction.java b/core/src/main/java/google/registry/tools/server/ListPremiumListsAction.java index f35a18f46..fc5c475b8 100644 --- a/core/src/main/java/google/registry/tools/server/ListPremiumListsAction.java +++ b/core/src/main/java/google/registry/tools/server/ListPremiumListsAction.java @@ -19,7 +19,6 @@ import static google.registry.persistence.transaction.TransactionManagerFactory. import static google.registry.request.Action.Method.GET; import static google.registry.request.Action.Method.POST; -import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import google.registry.model.registry.label.PremiumList; import google.registry.request.Action; @@ -58,16 +57,6 @@ public final class ListPremiumListsAction extends ListObjectsAction .map(PremiumListDao::getLatestRevision) .filter(Optional::isPresent) .map(Optional::get) - .peek(list -> list.getLabelsToPrices()) .collect(toImmutableSortedSet(Comparator.comparing(PremiumList::getName)))); } - - /** - * Provide a field override for labelsToPrices, since it is an {@code Insignificant} field and - * doesn't get returned from {@link google.registry.model.ImmutableObject#toDiffableFieldMap}. - */ - @Override - public ImmutableMap getFieldOverrides(PremiumList list) { - return ImmutableMap.of("labelsToPrices", list.getLabelsToPrices().toString()); - } } diff --git a/core/src/test/java/google/registry/tools/server/ListPremiumListsActionTest.java b/core/src/test/java/google/registry/tools/server/ListPremiumListsActionTest.java index ec43c3de3..a2191b0be 100644 --- a/core/src/test/java/google/registry/tools/server/ListPremiumListsActionTest.java +++ b/core/src/test/java/google/registry/tools/server/ListPremiumListsActionTest.java @@ -43,19 +43,6 @@ class ListPremiumListsActionTest extends ListActionTestCase { "^xn--q9jyb4c$"); } - @Test - void testRun_withLabelsToPrices() { - testRunSuccess( - action, - Optional.of("labelsToPrices"), - Optional.empty(), - Optional.empty(), - "^name\\s+labelsToPrices\\s*$", - "^-+\\s+-+\\s*$", - "^how\\s+\\{richer=5000.00\\}$", - "^xn--q9jyb4c\\s+\\{rich=100\\.00\\}\\s+$"); - } - @Test void testRun_withBadField_returnsError() { testRunError(