diff --git a/javatests/google/registry/tools/BUILD b/javatests/google/registry/tools/BUILD index aec7938e2..9583f12ff 100644 --- a/javatests/google/registry/tools/BUILD +++ b/javatests/google/registry/tools/BUILD @@ -10,7 +10,9 @@ load("//java/com/google/testing/builddefs:GenTestRules.bzl", "GenTestRules") java_library( name = "tools", - srcs = glob(["*.java"]), + srcs = glob([ + "*.java", + ]), resources = glob(["testdata/*.*"]), deps = [ "//java/com/google/common/annotations", diff --git a/javatests/google/registry/tools/CommandTestCase.java b/javatests/google/registry/tools/CommandTestCase.java index 246a95366..bf3cb83e3 100644 --- a/javatests/google/registry/tools/CommandTestCase.java +++ b/javatests/google/registry/tools/CommandTestCase.java @@ -93,12 +93,12 @@ public abstract class CommandTestCase { } } - void runCommand(String... args) throws Exception { + protected void runCommand(String... args) throws Exception { runCommandInEnvironment(RegistryToolEnvironment.UNITTEST, args); } /** Adds "--force" as the first parameter, then runs the command. */ - void runCommandForced(String... args) throws Exception { + protected void runCommandForced(String... args) throws Exception { runCommand(ObjectArrays.concat("--force", args)); } @@ -149,8 +149,10 @@ public abstract class CommandTestCase { return ofy().load().type(PollMessage.class).count(); } - void assertInStdout(String expected) throws Exception { - assertThat(stdout.toString(UTF_8.toString())).contains(expected); + protected void assertInStdout(String... expected) throws Exception { + for (String line : expected) { + assertThat(stdout.toString(UTF_8.toString())).contains(line); + } } void assertNotInStdout(String expected) throws Exception {