Use the Builder pattern for BuildEventService{Transport,ProtoUtil} and BuildEventStreamer.
By using builders we can simplify the creation of those objects in
the BuildEventServiceModule, but most importantly we can better handle the
possible exceptions thrown at Object creation instead of catching generic
Exceptions (as we currently do in tryCreateBesStreamer) which
may hide unchecked exceptions from being surfaced at the right place.
PiperOrigin-RevId: 234964615
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java b/src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java
index 5be246d..fef7e48 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java
@@ -1028,7 +1028,12 @@
options.publishAllActions = true;
BuildEventStreamer streamer =
- new BuildEventStreamer(ImmutableSet.of(transport), reporter, options, artifactGroupNamer);
+ new BuildEventStreamer.Builder()
+ .artifactGroupNamer(artifactGroupNamer)
+ .besStreamOptions(options)
+ .cmdLineReporter(reporter)
+ .buildEventTransports(ImmutableSet.of(transport))
+ .build();
ActionExecutedEvent failedActionExecutedEvent =
new ActionExecutedEvent(