Restore global config after tests

Fix a couple more cases when caching related configs are changed.
This does not fix all our problems with Gradle builds.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=228735790
This commit is contained in:
weiminyu 2019-01-10 10:41:39 -08:00 committed by Ben McIlwain
parent 4866955c76
commit f94090c415
4 changed files with 50 additions and 24 deletions

View file

@ -391,9 +391,14 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
@Test
public void testSuccess_cachingDisabled() throws Exception {
RegistryConfig.overrideIsEppResourceCachingEnabledForTesting(false);
persistContactsAndHosts();
doSuccessfulTest();
boolean origIsCachingEnabled = RegistryConfig.isEppResourceCachingEnabled();
try {
RegistryConfig.overrideIsEppResourceCachingEnabledForTesting(false);
persistContactsAndHosts();
doSuccessfulTest();
} finally {
RegistryConfig.overrideIsEppResourceCachingEnabledForTesting(origIsCachingEnabled);
}
}
@Test