mirror of
https://github.com/google/nomulus
synced 2026-09-05 07:37:09 +00:00
Add domain_lock nomulus command
This command is used by registry operators to apply registry locks to domain names. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=176549874
This commit is contained in:
@@ -20,9 +20,7 @@ import static google.registry.util.ResourceUtils.readResourceUtf8;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
/**
|
||||
* Contains helper methods for dealing with test data.
|
||||
*/
|
||||
/** Contains helper methods for dealing with test data. */
|
||||
public final class TestDataHelper {
|
||||
|
||||
/**
|
||||
@@ -31,7 +29,11 @@ public final class TestDataHelper {
|
||||
*/
|
||||
public static String loadFileWithSubstitutions(
|
||||
Class<?> context, String filename, Map<String, String> substitutions) {
|
||||
String fileContents = readResourceUtf8(context, "testdata/" + filename);
|
||||
return applySubstitutions(readResourceUtf8(context, "testdata/" + filename), substitutions);
|
||||
}
|
||||
|
||||
/** Applies the given substitutions to the given string and returns the result. */
|
||||
public static String applySubstitutions(String fileContents, Map<String, String> substitutions) {
|
||||
for (Entry<String, String> entry : nullToEmpty(substitutions).entrySet()) {
|
||||
fileContents = fileContents.replaceAll("%" + entry.getKey() + "%", entry.getValue());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user