Allow setting the OutputService in tests.
@@ -477,13 +477,17 @@ public final class CommandEnvironment {
return workingDirectory;
}
- /**
- * @return the OutputService in use, or null if none.
- */
+ /** @return the OutputService in use, or null if none. */
+ @Nullable
public OutputService getOutputService() {
return outputService;
}
+ @VisibleForTesting
+ public void setOutputServiceForTesting(@Nullable OutputService outputService) {
+ this.outputService = outputService;
+ }
+
public ActionCache getPersistentActionCache() throws IOException {
return workspace.getPersistentActionCache(reporter);
}
