mirror of
https://github.com/google/nomulus.git
synced 2025-07-20 17:56:08 +02:00
Move premium list static helper methods into their own class
It was kind of messy having all of that logic living alongside the entities themselves. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=148498024
This commit is contained in:
parent
388dd1055e
commit
ea4e471c04
12 changed files with 523 additions and 421 deletions
|
@ -17,6 +17,7 @@ package google.registry.tools;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth.assertWithMessage;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.model.registry.label.PremiumListUtils.loadPremiumListEntries;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.persistPremiumList;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
@ -32,7 +33,7 @@ public class DeletePremiumListCommandTest extends CommandTestCase<DeletePremiumL
|
|||
@Test
|
||||
public void testSuccess() throws Exception {
|
||||
PremiumList premiumList = persistPremiumList("xn--q9jyb4c", "blah,USD 100");
|
||||
assertThat(premiumList.loadPremiumListEntries()).hasSize(1);
|
||||
assertThat(loadPremiumListEntries(premiumList)).hasSize(1);
|
||||
runCommand("--force", "--name=xn--q9jyb4c");
|
||||
assertThat(PremiumList.get("xn--q9jyb4c")).isAbsent();
|
||||
|
||||
|
@ -62,7 +63,8 @@ public class DeletePremiumListCommandTest extends CommandTestCase<DeletePremiumL
|
|||
} catch (IllegalArgumentException e) {
|
||||
assertThat(PremiumList.get(premiumList.getName())).isPresent();
|
||||
assertThat(e)
|
||||
.hasMessage("Cannot delete premium list because it is used on these tld(s): xn--q9jyb4c");
|
||||
.hasMessageThat()
|
||||
.isEqualTo("Cannot delete premium list because it is used on these tld(s): xn--q9jyb4c");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue