mirror of
https://github.com/google/nomulus
synced 2026-09-19 06:32:00 +00:00
Migrate final try/catch test assertions to use assert/expectThrows
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=182091814
This commit is contained in:
@@ -16,7 +16,6 @@ package google.registry.flows.domain;
|
||||
|
||||
import static com.google.common.io.BaseEncoding.base16;
|
||||
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.model.domain.fee.Fee.FEE_EXTENSION_URIS;
|
||||
import static google.registry.model.eppcommon.StatusValue.OK;
|
||||
@@ -998,21 +997,14 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||
public void testFailure_alreadyExists() throws Exception {
|
||||
persistContactsAndHosts();
|
||||
persistActiveDomain(getUniqueIdFromCommand());
|
||||
try {
|
||||
runFlow();
|
||||
assert_()
|
||||
.fail(
|
||||
"Expected to throw ResourceAlreadyExistsException with message "
|
||||
+ "Object with given ID (%s) already exists",
|
||||
getUniqueIdFromCommand());
|
||||
} catch (ResourceAlreadyExistsException e) {
|
||||
assertAboutEppExceptions()
|
||||
.that(e)
|
||||
.marshalsToXml()
|
||||
.and()
|
||||
.hasMessage(
|
||||
String.format("Object with given ID (%s) already exists", getUniqueIdFromCommand()));
|
||||
}
|
||||
ResourceAlreadyExistsException thrown =
|
||||
expectThrows(ResourceAlreadyExistsException.class, this::runFlow);
|
||||
assertAboutEppExceptions()
|
||||
.that(thrown)
|
||||
.marshalsToXml()
|
||||
.and()
|
||||
.hasMessage(
|
||||
String.format("Object with given ID (%s) already exists", getUniqueIdFromCommand()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user