mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Finish YAMLification of last necessary config values
There are still some options in RegistryConfig that can't be configured in YAML, but it's not clear why anyone would need to change them from their default values. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=146482435
This commit is contained in:
parent
4031988409
commit
61230b035c
12 changed files with 92 additions and 60 deletions
|
@ -591,9 +591,8 @@ public final class RegistryConfig {
|
||||||
*/
|
*/
|
||||||
@Provides
|
@Provides
|
||||||
@Config("rdeSshIdentity")
|
@Config("rdeSshIdentity")
|
||||||
public static String provideSshIdentity() {
|
public static String provideSshIdentity(RegistryConfigSettings config) {
|
||||||
// Change this to your RDE identity.
|
return config.rde.sshIdentityEmailAddress;
|
||||||
return "rde@example.com";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -711,8 +710,8 @@ public final class RegistryConfig {
|
||||||
*/
|
*/
|
||||||
@Provides
|
@Provides
|
||||||
@Config("rdapLinkBase")
|
@Config("rdapLinkBase")
|
||||||
public static String provideRdapLinkBase() {
|
public static String provideRdapLinkBase(RegistryConfigSettings config) {
|
||||||
return "https://nic.google/rdap/";
|
return config.rdap.baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -781,20 +780,8 @@ public final class RegistryConfig {
|
||||||
*/
|
*/
|
||||||
@Provides
|
@Provides
|
||||||
@Config("whoisDisclaimer")
|
@Config("whoisDisclaimer")
|
||||||
public static String provideWhoisDisclaimer() {
|
public static String provideWhoisDisclaimer(RegistryConfigSettings config) {
|
||||||
return "WHOIS information is provided by Charleston Road Registry Inc. (CRR) solely for\n"
|
return config.registryPolicy.whoisDisclaimer;
|
||||||
+ "query-based, informational purposes. By querying our WHOIS database, you are\n"
|
|
||||||
+ "agreeing to comply with these terms\n"
|
|
||||||
+ "(http://www.registry.google/about/whois-disclaimer.html) so please read them\n"
|
|
||||||
+ "carefully. Any information provided is \"as is\" without any guarantee of\n"
|
|
||||||
+ "accuracy. You may not use such information to (a) allow, enable, or otherwise\n"
|
|
||||||
+ "support the transmission of mass unsolicited, commercial advertising or\n"
|
|
||||||
+ "solicitations; (b) enable high volume, automated, electronic processes that\n"
|
|
||||||
+ "access the systems of CRR or any ICANN-Accredited Registrar, except as\n"
|
|
||||||
+ "reasonably necessary to register domain names or modify existing registrations;\n"
|
|
||||||
+ "or (c) engage in or support unlawful behavior. CRR reserves the right to\n"
|
|
||||||
+ "restrict or deny your access to the Whois database, and may modify these terms\n"
|
|
||||||
+ "at any time.\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -889,8 +876,8 @@ public final class RegistryConfig {
|
||||||
*/
|
*/
|
||||||
@Provides
|
@Provides
|
||||||
@Config("greetingServerId")
|
@Config("greetingServerId")
|
||||||
public static String provideGreetingServerId() {
|
public static String provideGreetingServerId(RegistryConfigSettings config) {
|
||||||
return "Charleston Road Registry";
|
return config.registryPolicy.greetingServerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
@ -905,13 +892,6 @@ public final class RegistryConfig {
|
||||||
return config.registryPolicy.whoisCommandFactoryClass;
|
return config.registryPolicy.whoisCommandFactoryClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String RESERVED_TERMS_EXPORT_DISCLAIMER = ""
|
|
||||||
+ "# This list contains reserve terms for the TLD. Other terms may be reserved\n"
|
|
||||||
+ "# but not included in this list, including terms EXAMPLE REGISTRY chooses not\n"
|
|
||||||
+ "# to publish, and terms that ICANN commonly mandates to be reserved. This\n"
|
|
||||||
+ "# list is subject to change and the most up-to-date source is always to\n"
|
|
||||||
+ "# check availability directly with the Registry server.\n";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the header text at the top of the reserved terms exported list.
|
* Returns the header text at the top of the reserved terms exported list.
|
||||||
*
|
*
|
||||||
|
@ -919,8 +899,8 @@ public final class RegistryConfig {
|
||||||
*/
|
*/
|
||||||
@Provides
|
@Provides
|
||||||
@Config("reservedTermsExportDisclaimer")
|
@Config("reservedTermsExportDisclaimer")
|
||||||
public static String provideReservedTermsExportDisclaimer() {
|
public static String provideReservedTermsExportDisclaimer(RegistryConfigSettings config) {
|
||||||
return RESERVED_TERMS_EXPORT_DISCLAIMER;
|
return config.registryPolicy.reservedTermsExportDisclaimer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -928,8 +908,8 @@ public final class RegistryConfig {
|
||||||
*/
|
*/
|
||||||
@Provides
|
@Provides
|
||||||
@Config("checkApiServletRegistrarClientId")
|
@Config("checkApiServletRegistrarClientId")
|
||||||
public static String provideCheckApiServletRegistrarClientId() {
|
public static String provideCheckApiServletRegistrarClientId(RegistryConfigSettings config) {
|
||||||
return "TheRegistrar";
|
return config.registryPolicy.checkApiServletClientId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
|
@ -1114,6 +1094,16 @@ public final class RegistryConfig {
|
||||||
return Duration.standardSeconds(CONFIG_SETTINGS.get().caching.singletonCachePersistSeconds);
|
return Duration.standardSeconds(CONFIG_SETTINGS.get().caching.singletonCachePersistSeconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the email address that outgoing emails from the app are sent from. */
|
||||||
|
public static String getGSuiteOutgoingEmailAddress() {
|
||||||
|
return CONFIG_SETTINGS.get().gSuite.outgoingEmailAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the display name that outgoing emails from the app are sent from. */
|
||||||
|
public static String getGSuiteOutgoingEmailDisplayName() {
|
||||||
|
return CONFIG_SETTINGS.get().gSuite.outgoingEmailDisplayName;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns default WHOIS server to use when {@code Registrar#getWhoisServer()} is {@code null}.
|
* Returns default WHOIS server to use when {@code Registrar#getWhoisServer()} is {@code null}.
|
||||||
*
|
*
|
||||||
|
@ -1168,15 +1158,5 @@ public final class RegistryConfig {
|
||||||
return getConfigSettings();
|
return getConfigSettings();
|
||||||
}});
|
}});
|
||||||
|
|
||||||
/** Config values used for local and unit test environments. */
|
|
||||||
public static class LocalTestConfig {
|
|
||||||
|
|
||||||
public static final String RESERVED_TERMS_TEST_EXPORT_DISCLAIMER = "This is a disclaimer.\n";
|
|
||||||
|
|
||||||
public static final String GOOGLE_APPS_SEND_FROM_EMAIL_ADDRESS = "noreply@testing.example";
|
|
||||||
|
|
||||||
public static final String GOOGLE_APPS_ADMIN_EMAIL_DISPLAY_NAME = "Testing Nomulus";
|
|
||||||
}
|
|
||||||
|
|
||||||
private RegistryConfig() {}
|
private RegistryConfig() {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ public class RegistryConfigSettings {
|
||||||
public RegistrarConsole registrarConsole;
|
public RegistrarConsole registrarConsole;
|
||||||
public Monitoring monitoring;
|
public Monitoring monitoring;
|
||||||
public Misc misc;
|
public Misc misc;
|
||||||
|
public Rdap rdap;
|
||||||
public Braintree braintree;
|
public Braintree braintree;
|
||||||
|
|
||||||
/** Configuration options that apply to the entire App Engine project. */
|
/** Configuration options that apply to the entire App Engine project. */
|
||||||
|
@ -58,12 +59,16 @@ public class RegistryConfigSettings {
|
||||||
public String customLogicFactoryClass;
|
public String customLogicFactoryClass;
|
||||||
public String whoisCommandFactoryClass;
|
public String whoisCommandFactoryClass;
|
||||||
public int contactAutomaticTransferDays;
|
public int contactAutomaticTransferDays;
|
||||||
|
public String greetingServerId;
|
||||||
public List<String> registrarChangesNotificationEmailAddresses;
|
public List<String> registrarChangesNotificationEmailAddresses;
|
||||||
public String defaultRegistrarWhoisServer;
|
public String defaultRegistrarWhoisServer;
|
||||||
public String defaultRegistrarReferralUrl;
|
public String defaultRegistrarReferralUrl;
|
||||||
public String tmchCaMode;
|
public String tmchCaMode;
|
||||||
public String tmchCrlUrl;
|
public String tmchCrlUrl;
|
||||||
public String tmchMarksDbUrl;
|
public String tmchMarksDbUrl;
|
||||||
|
public String checkApiServletClientId;
|
||||||
|
public String reservedTermsExportDisclaimer;
|
||||||
|
public String whoisDisclaimer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Configuration for Cloud Datastore. */
|
/** Configuration for Cloud Datastore. */
|
||||||
|
@ -84,6 +89,7 @@ public class RegistryConfigSettings {
|
||||||
public static class Rde {
|
public static class Rde {
|
||||||
public String reportUrlPrefix;
|
public String reportUrlPrefix;
|
||||||
public String uploadUrl;
|
public String uploadUrl;
|
||||||
|
public String sshIdentityEmailAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Configuration for the web-based registrar console. */
|
/** Configuration for the web-based registrar console. */
|
||||||
|
@ -108,6 +114,11 @@ public class RegistryConfigSettings {
|
||||||
public String sheetExportId;
|
public String sheetExportId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Configuration for RDAP. */
|
||||||
|
public static class Rdap {
|
||||||
|
public String baseUrl;
|
||||||
|
}
|
||||||
|
|
||||||
/** Configuration for Braintree credit card payment processing. */
|
/** Configuration for Braintree credit card payment processing. */
|
||||||
public static class Braintree {
|
public static class Braintree {
|
||||||
public String merchantId;
|
public String merchantId;
|
||||||
|
|
|
@ -44,6 +44,9 @@ registryPolicy:
|
||||||
# Length of time after which contact transfers automatically conclude.
|
# Length of time after which contact transfers automatically conclude.
|
||||||
contactAutomaticTransferDays: 5
|
contactAutomaticTransferDays: 5
|
||||||
|
|
||||||
|
# Server ID used in the 'svID' element of an EPP 'greeting'.
|
||||||
|
greetingServerId: Nomulus Registry
|
||||||
|
|
||||||
# List of email addresses that notifications of registrar and/or registrar
|
# List of email addresses that notifications of registrar and/or registrar
|
||||||
# contact updates should be sent to, or empty list for no notifications.
|
# contact updates should be sent to, or empty list for no notifications.
|
||||||
registrarChangesNotificationEmailAddresses: []
|
registrarChangesNotificationEmailAddresses: []
|
||||||
|
@ -64,6 +67,31 @@ registryPolicy:
|
||||||
# URL for the MarksDB registry interface.
|
# URL for the MarksDB registry interface.
|
||||||
tmchMarksDbUrl: https://test.ry.marksdb.org
|
tmchMarksDbUrl: https://test.ry.marksdb.org
|
||||||
|
|
||||||
|
# Registry’s operations registrar, used for front-end availability/premium
|
||||||
|
# domain checks.
|
||||||
|
checkApiServletClientId: TheRegistrar
|
||||||
|
|
||||||
|
# Disclaimer at the top of the exported reserved terms list.
|
||||||
|
reservedTermsExportDisclaimer: |
|
||||||
|
This list contains reserved terms for the TLD. Other terms may be reserved
|
||||||
|
but not included in this list, including terms the registry chooses not
|
||||||
|
to publish, and terms that ICANN commonly mandates to be reserved. This
|
||||||
|
list is subject to change and the most up-to-date source is always to
|
||||||
|
check availability directly with the Registry server.
|
||||||
|
|
||||||
|
# Disclaimer at the top of WHOIS results.
|
||||||
|
whoisDisclaimer: |
|
||||||
|
WHOIS information is provided by the registry solely for query-based,
|
||||||
|
informational purposes. Any information provided is "as is" without any
|
||||||
|
guarantee of accuracy. You may not use such information to (a) allow,
|
||||||
|
enable, or otherwise support the transmission of mass unsolicited,
|
||||||
|
commercial advertising or solicitations; (b) enable high volume, automated,
|
||||||
|
electronic processes that access the registry's systems or any
|
||||||
|
ICANN-Accredited Registrar, except as reasonably necessary to register
|
||||||
|
domain names or modify existing registrations; or (c) engage in or support
|
||||||
|
unlawful behavior. We reserve the right to restrict or deny your access to
|
||||||
|
the WHOIS database, and may modify these terms at any time.
|
||||||
|
|
||||||
datastore:
|
datastore:
|
||||||
# Number of commit log buckets in Datastore. Don't change after initial
|
# Number of commit log buckets in Datastore. Don't change after initial
|
||||||
# install.
|
# install.
|
||||||
|
@ -96,6 +124,9 @@ rde:
|
||||||
# but not the password.
|
# but not the password.
|
||||||
uploadUrl: sftp://username@rde-provider.example
|
uploadUrl: sftp://username@rde-provider.example
|
||||||
|
|
||||||
|
# Identity of the SSH keys (stored in the Keyring) used for RDE SFTP uploads.
|
||||||
|
sshIdentityEmailAddress: rde@example.com
|
||||||
|
|
||||||
registrarConsole:
|
registrarConsole:
|
||||||
# Filename of the logo to use in the header of the console. This filename is
|
# Filename of the logo to use in the header of the console. This filename is
|
||||||
# relative to ui/assets/images/
|
# relative to ui/assets/images/
|
||||||
|
@ -133,6 +164,10 @@ misc:
|
||||||
# to. Leave this null to disable syncing.
|
# to. Leave this null to disable syncing.
|
||||||
sheetExportId: null
|
sheetExportId: null
|
||||||
|
|
||||||
|
rdap:
|
||||||
|
# Base URL (with trailing slash) for RDAP links.
|
||||||
|
baseUrl: http://domain-registry.example/rdap/
|
||||||
|
|
||||||
# Braintree is a credit card payment processor that is used on the registrar
|
# Braintree is a credit card payment processor that is used on the registrar
|
||||||
# console to allow registrars to pay their invoices.
|
# console to allow registrars to pay their invoices.
|
||||||
braintree:
|
braintree:
|
||||||
|
|
|
@ -19,6 +19,7 @@ gSuite:
|
||||||
registryPolicy:
|
registryPolicy:
|
||||||
contactAndHostRoidSuffix: placeholder
|
contactAndHostRoidSuffix: placeholder
|
||||||
productName: placeholder
|
productName: placeholder
|
||||||
|
greetingServerId: placeholder
|
||||||
registrarChangesNotificationEmailAddresses:
|
registrarChangesNotificationEmailAddresses:
|
||||||
- placeholder
|
- placeholder
|
||||||
- placeholder
|
- placeholder
|
||||||
|
@ -27,10 +28,17 @@ registryPolicy:
|
||||||
tmchCaMode: PRODUCTION
|
tmchCaMode: PRODUCTION
|
||||||
tmchCrlUrl: http://crl.icann.org/tmch.crl
|
tmchCrlUrl: http://crl.icann.org/tmch.crl
|
||||||
tmchMarksDbUrl: https://ry.marksdb.org
|
tmchMarksDbUrl: https://ry.marksdb.org
|
||||||
|
checkApiServletClientId: |
|
||||||
|
multi-line
|
||||||
|
placeholder
|
||||||
|
whoisDisclaimer: |
|
||||||
|
multi-line
|
||||||
|
placeholder
|
||||||
|
|
||||||
rde:
|
rde:
|
||||||
reportUrlPrefix: https://ry-api.icann.org/report/registry-escrow-report
|
reportUrlPrefix: https://ry-api.icann.org/report/registry-escrow-report
|
||||||
uploadUrl: sftp://placeholder@sftpipm2.ironmountain.com/Outbox
|
uploadUrl: sftp://placeholder@sftpipm2.ironmountain.com/Outbox
|
||||||
|
sshIdentityEmailAddress: placeholder
|
||||||
|
|
||||||
registrarConsole:
|
registrarConsole:
|
||||||
logoFilename: placeholder
|
logoFilename: placeholder
|
||||||
|
@ -43,6 +51,9 @@ registrarConsole:
|
||||||
misc:
|
misc:
|
||||||
sheetExportId: placeholder
|
sheetExportId: placeholder
|
||||||
|
|
||||||
|
rdap:
|
||||||
|
baseUrl: placeholder
|
||||||
|
|
||||||
# You only need to specify this section if using Braintree.
|
# You only need to specify this section if using Braintree.
|
||||||
braintree:
|
braintree:
|
||||||
merchantId: placeholder
|
merchantId: placeholder
|
||||||
|
|
|
@ -32,7 +32,6 @@ import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.net.MediaType;
|
import com.google.common.net.MediaType;
|
||||||
import google.registry.config.RegistryConfig.LocalTestConfig;
|
|
||||||
import google.registry.model.registry.Registry;
|
import google.registry.model.registry.Registry;
|
||||||
import google.registry.model.registry.label.ReservedList;
|
import google.registry.model.registry.label.ReservedList;
|
||||||
import google.registry.request.Response;
|
import google.registry.request.Response;
|
||||||
|
@ -65,7 +64,7 @@ public class ExportReservedTermsActionTest {
|
||||||
ExportReservedTermsAction action = new ExportReservedTermsAction();
|
ExportReservedTermsAction action = new ExportReservedTermsAction();
|
||||||
action.response = response;
|
action.response = response;
|
||||||
action.driveConnection = driveConnection;
|
action.driveConnection = driveConnection;
|
||||||
action.exportUtils = new ExportUtils(LocalTestConfig.RESERVED_TERMS_TEST_EXPORT_DISCLAIMER);
|
action.exportUtils = new ExportUtils("This is a disclaimer.\n");
|
||||||
action.tld = tld;
|
action.tld = tld;
|
||||||
action.run();
|
action.run();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
package google.registry.export;
|
package google.registry.export;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static google.registry.config.RegistryConfig.LocalTestConfig.RESERVED_TERMS_TEST_EXPORT_DISCLAIMER;
|
|
||||||
import static google.registry.testing.DatastoreHelper.createTld;
|
import static google.registry.testing.DatastoreHelper.createTld;
|
||||||
import static google.registry.testing.DatastoreHelper.persistReservedList;
|
import static google.registry.testing.DatastoreHelper.persistReservedList;
|
||||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||||
|
@ -57,9 +56,7 @@ public class ExportUtilsTest {
|
||||||
createTld("tld");
|
createTld("tld");
|
||||||
persistResource(Registry.get("tld").asBuilder().setReservedLists(rl1, rl2, rl3).build());
|
persistResource(Registry.get("tld").asBuilder().setReservedLists(rl1, rl2, rl3).build());
|
||||||
// Should not contain jimmy, tine, or oval.
|
// Should not contain jimmy, tine, or oval.
|
||||||
assertThat(
|
assertThat(new ExportUtils("This is a disclaimer.\n").exportReservedTerms(Registry.get("tld")))
|
||||||
new ExportUtils(RESERVED_TERMS_TEST_EXPORT_DISCLAIMER)
|
|
||||||
.exportReservedTerms(Registry.get("tld")))
|
|
||||||
.isEqualTo("This is a disclaimer.\ncat\nlol\nsnow\n");
|
.isEqualTo("This is a disclaimer.\ncat\nlol\nsnow\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class EppLoggedOutTest extends EppTestCase {
|
||||||
assertCommandAndResponse(
|
assertCommandAndResponse(
|
||||||
"hello.xml",
|
"hello.xml",
|
||||||
null,
|
null,
|
||||||
"greeting_crr.xml",
|
"greeting.xml",
|
||||||
ImmutableMap.of("DATE", now.toString(dateTimeNoMillis())),
|
ImmutableMap.of("DATE", now.toString(dateTimeNoMillis())),
|
||||||
now);
|
now);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class HelloFlowTest extends FlowTestCase<HelloFlow> {
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
loadFileWithSubstitutions(
|
loadFileWithSubstitutions(
|
||||||
getClass(),
|
getClass(),
|
||||||
"greeting_crr.xml",
|
"greeting.xml",
|
||||||
ImmutableMap.of("DATE", clock.nowUtc().toString(dateTimeNoMillis()))));
|
ImmutableMap.of("DATE", clock.nowUtc().toString(dateTimeNoMillis()))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||||
<greeting>
|
<greeting>
|
||||||
<svID>Charleston Road Registry</svID>
|
<svID>Nomulus Registry</svID>
|
||||||
<svDate>%DATE%</svDate>
|
<svDate>%DATE%</svDate>
|
||||||
<svcMenu>
|
<svcMenu>
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
|
@ -1,6 +1,6 @@
|
||||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||||
<greeting>
|
<greeting>
|
||||||
<svID>Charleston Road Registry</svID>
|
<svID>Nomulus Registry</svID>
|
||||||
<svDate>%DATE%</svDate>
|
<svDate>%DATE%</svDate>
|
||||||
<svcMenu>
|
<svcMenu>
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
package google.registry.ui.server.registrar;
|
package google.registry.ui.server.registrar;
|
||||||
|
|
||||||
import static google.registry.config.RegistryConfig.LocalTestConfig.GOOGLE_APPS_ADMIN_EMAIL_DISPLAY_NAME;
|
import static google.registry.config.RegistryConfig.getGSuiteOutgoingEmailAddress;
|
||||||
import static google.registry.config.RegistryConfig.LocalTestConfig.GOOGLE_APPS_SEND_FROM_EMAIL_ADDRESS;
|
import static google.registry.config.RegistryConfig.getGSuiteOutgoingEmailDisplayName;
|
||||||
import static google.registry.security.JsonHttpTestUtils.createJsonPayload;
|
import static google.registry.security.JsonHttpTestUtils.createJsonPayload;
|
||||||
import static google.registry.security.JsonHttpTestUtils.createJsonResponseSupplier;
|
import static google.registry.security.JsonHttpTestUtils.createJsonResponseSupplier;
|
||||||
import static google.registry.security.XsrfTokenManager.generateToken;
|
import static google.registry.security.XsrfTokenManager.generateToken;
|
||||||
|
@ -102,8 +102,7 @@ public class RegistrarSettingsActionTestCase {
|
||||||
action.registrarChangesNotificationEmailAddresses = ImmutableList.of(
|
action.registrarChangesNotificationEmailAddresses = ImmutableList.of(
|
||||||
"notification@test.example", "notification2@test.example");
|
"notification@test.example", "notification2@test.example");
|
||||||
action.sendEmailUtils =
|
action.sendEmailUtils =
|
||||||
new SendEmailUtils(
|
new SendEmailUtils(getGSuiteOutgoingEmailAddress(), getGSuiteOutgoingEmailDisplayName());
|
||||||
GOOGLE_APPS_SEND_FROM_EMAIL_ADDRESS, GOOGLE_APPS_ADMIN_EMAIL_DISPLAY_NAME);
|
|
||||||
inject.setStaticField(Ofy.class, "clock", clock);
|
inject.setStaticField(Ofy.class, "clock", clock);
|
||||||
inject.setStaticField(SendEmailUtils.class, "emailService", emailService);
|
inject.setStaticField(SendEmailUtils.class, "emailService", emailService);
|
||||||
inject.setStaticField(SyncRegistrarsSheetAction.class, "modulesService", modulesService);
|
inject.setStaticField(SyncRegistrarsSheetAction.class, "modulesService", modulesService);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
package google.registry.ui.server.registrar;
|
package google.registry.ui.server.registrar;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
import static google.registry.config.RegistryConfig.getGSuiteOutgoingEmailAddress;
|
||||||
|
import static google.registry.config.RegistryConfig.getGSuiteOutgoingEmailDisplayName;
|
||||||
import static org.mockito.Matchers.any;
|
import static org.mockito.Matchers.any;
|
||||||
import static org.mockito.Mockito.doThrow;
|
import static org.mockito.Mockito.doThrow;
|
||||||
import static org.mockito.Mockito.never;
|
import static org.mockito.Mockito.never;
|
||||||
|
@ -22,7 +24,6 @@ import static org.mockito.Mockito.verify;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import google.registry.config.RegistryConfig.LocalTestConfig;
|
|
||||||
import google.registry.testing.ExceptionRule;
|
import google.registry.testing.ExceptionRule;
|
||||||
import google.registry.testing.InjectRule;
|
import google.registry.testing.InjectRule;
|
||||||
import google.registry.util.SendEmailService;
|
import google.registry.util.SendEmailService;
|
||||||
|
@ -61,9 +62,8 @@ public class SendEmailUtilsTest {
|
||||||
inject.setStaticField(SendEmailUtils.class, "emailService", emailService);
|
inject.setStaticField(SendEmailUtils.class, "emailService", emailService);
|
||||||
message = new MimeMessage(Session.getDefaultInstance(new Properties(), null));
|
message = new MimeMessage(Session.getDefaultInstance(new Properties(), null));
|
||||||
when(emailService.createMessage()).thenReturn(message);
|
when(emailService.createMessage()).thenReturn(message);
|
||||||
sendEmailUtils = new SendEmailUtils(
|
sendEmailUtils =
|
||||||
LocalTestConfig.GOOGLE_APPS_SEND_FROM_EMAIL_ADDRESS,
|
new SendEmailUtils(getGSuiteOutgoingEmailAddress(), getGSuiteOutgoingEmailDisplayName());
|
||||||
LocalTestConfig.GOOGLE_APPS_ADMIN_EMAIL_DISPLAY_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue