From 3d5ab8d068103b8d3983d19be481593d85cb9b3a Mon Sep 17 00:00:00 2001 From: mountford Date: Fri, 30 Sep 2016 15:05:11 -0700 Subject: [PATCH] Add success exception for TestExtraLogicManager TestExtraLogicManager is pretty kludgy, and should be replaced with injection, mocking, etc. But in the meantime, using a dedicated error to signal its success, rather than IllegalArgumentException as was done before, at least makes things a little easier to follow. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=134832315 --- .../flows/domain/DomainCreateFlowTest.java | 3 ++- .../flows/domain/DomainDeleteFlowTest.java | 3 ++- .../flows/domain/DomainRenewFlowTest.java | 3 ++- .../domain/DomainRestoreRequestFlowTest.java | 3 ++- .../domain/DomainTransferRequestFlowTest.java | 4 +++- .../flows/domain/DomainUpdateFlowTest.java | 16 +++++++++++----- .../model/domain/TestExtraLogicManager.java | 15 ++++++++++++++- 7 files changed, 36 insertions(+), 11 deletions(-) diff --git a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java index 50a52a772..a33814c01 100644 --- a/javatests/google/registry/flows/domain/DomainCreateFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainCreateFlowTest.java @@ -106,6 +106,7 @@ import google.registry.model.domain.DomainResource; import google.registry.model.domain.GracePeriod; import google.registry.model.domain.LrpToken; import google.registry.model.domain.TestExtraLogicManager; +import google.registry.model.domain.TestExtraLogicManager.TestExtraLogicManagerSuccessException; import google.registry.model.domain.launch.ApplicationStatus; import google.registry.model.domain.launch.LaunchNotice; import google.registry.model.domain.rgp.GracePeriodStatus; @@ -1616,7 +1617,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase getExtensionFlags( DomainResource domainResource, String clientId, DateTime asOfDate) { @@ -221,6 +234,6 @@ public class TestExtraLogicManager implements RegistryExtraFlowLogic { public void commitAdditionalLogicChanges() { checkNotNull(messageToThrow); // Throw a specific exception as a signal to the test code that we made it through to here. - throw new IllegalArgumentException(messageToThrow); + throw new TestExtraLogicManagerSuccessException(messageToThrow); } }