mirror of
https://github.com/google/nomulus
synced 2026-09-05 15:46:55 +00:00
Refactor assertCommandAndResponse to be "fluent"
This is in preparation for automatic EPP consolidation.
The assertion will now look like:
assertThatCommand("file.xml"[, substitution])
.atTime(time)
.hasResponse("file2.xml"[, substitution]);
Also, added convenience functions for often reused commands (login and logout)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190617505
This commit is contained in:
@@ -23,6 +23,7 @@ import com.google.common.io.ByteSource;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/** Contains helper methods for dealing with test data. */
|
||||
public final class TestDataHelper {
|
||||
@@ -56,7 +57,7 @@ public final class TestDataHelper {
|
||||
* context class, and substitutes in values for placeholders of the form <code>%tagname%</code>.
|
||||
*/
|
||||
public static String loadFile(
|
||||
Class<?> context, String filename, Map<String, String> substitutions) {
|
||||
Class<?> context, String filename, @Nullable Map<String, String> substitutions) {
|
||||
String fileContents = loadFile(context, filename);
|
||||
for (Entry<String, String> entry : nullToEmpty(substitutions).entrySet()) {
|
||||
fileContents = fileContents.replaceAll("%" + entry.getKey() + "%", entry.getValue());
|
||||
|
||||
Reference in New Issue
Block a user