mirror of
https://github.com/google/nomulus.git
synced 2025-06-28 07:13:34 +02: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:
parent
8cd3979385
commit
f041b1bac0
18 changed files with 453 additions and 35 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue