mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Improve a few assertion fails in tests
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=135479183
This commit is contained in:
parent
b62e60ed7e
commit
aaa84d6ec6
5 changed files with 12 additions and 31 deletions
|
@ -15,13 +15,13 @@
|
|||
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.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.deleteResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
|
@ -285,6 +285,7 @@ public class MutatingCommandTest {
|
|||
+ "blockPremiumNames -> [false, true]\n");
|
||||
try {
|
||||
command.execute();
|
||||
fail("Expected transaction to fail with IllegalStateException.");
|
||||
} catch (IllegalStateException e) {
|
||||
assertThat(e.getMessage()).contains("Entity changed since init() was called.");
|
||||
assertThat(ofy().load().entity(host1).now()).isNull();
|
||||
|
@ -293,9 +294,7 @@ public class MutatingCommandTest {
|
|||
// These two shouldn't've changed.
|
||||
assertThat(ofy().load().entity(registrar1).now()).isEqualTo(registrar1);
|
||||
assertThat(ofy().load().entity(registrar2).now()).isEqualTo(registrar2);
|
||||
return;
|
||||
}
|
||||
assertWithMessage("Expected transaction to fail with IllegalStateException").fail();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue