public ListenableFuture<RunResponse> runWithDeadline(RunRequest request, Deadline deadline) {
    return pluginService.withDeadline(deadline).run(request);
  }
@Test
  public void run_multiplePluginValidRequest_returnMultipleDetectionReports() throws Exception {
    int numPluginsToTest = 5;

    List<NetworkEndpoint> endpoints = new ArrayList<>(numPluginsToTest);
    endpoints.add(NetworkEndpointUtils.forIpAndPort("1.1.1.1", 80));
    endpoints.add(NetworkEndpointUtils.forIpAndPort("1.1.1.1", 443));
    endpoints.add(NetworkEndpointUtils.forIpAndPort("1.1.1.1", 123));
    endpoints.add(NetworkEndpointUtils.forIpAndPort("1.1.1.1", 456));
    endpoints.add(NetworkEndpointUtils.forIpAndPort("1.1.1.1", 789));

    PluginInfo.Builder pluginInfoBuilder =
        PluginInfo.newBuilder()
            .setType(PluginInfo.PluginType.VULN_DETECTION)
            .setVersion(PLUGIN_VERSION)
            .setDescription(PLUGIN_DESCRIPTION)
            .setAuthor(PLUGIN_AUTHOR);

    TargetInfo target = TargetInfo.newBuilder().addAllNetworkEndpoints(endpoints).build();

    RunRequest.Builder runRequestBuilder = RunRequest.newBuilder().setTarget(target);

    for (int i = 0; i < numPluginsToTest; i++) {
      PluginInfo pluginInfo =
          pluginInfoBuilder.setName(String.format(PLUGIN_NAME + " %d", i)).build();
      NetworkService httpService =
          NetworkService.newBuilder()
              .setNetworkEndpoint(endpoints.get(i))
              .setTransportProtocol(TransportProtocol.TCP)
              .setServiceName("http")
              .build();
      runRequestBuilder.addPlugins(
          MatchedPlugin.newBuilder()
              .addServices(httpService)
              .setPlugin(PluginDefinition.newBuilder().setInfo(pluginInfo).build()));
    }
    RunRequest runRequest = runRequestBuilder.build();

    PluginServiceImplBase runImpl =
        new PluginServiceImplBase() {
          @Override
          public void run(RunRequest request, StreamObserver<RunResponse> responseObserver) {
            DetectionReportList.Builder reportListBuilder = DetectionReportList.newBuilder();
            for (MatchedPlugin plugin : request.getPluginsList()) {
              reportListBuilder.addDetectionReports(
                  DetectionReport.newBuilder()
                      .setTargetInfo(request.getTarget())
                      .setNetworkService(plugin.getServices(0)));
            }
            responseObserver.onNext(RunResponse.newBuilder().setReports(reportListBuilder).build());
            responseObserver.onCompleted();
          }
        };
    serviceRegistry.addService(runImpl);

    ListenableFuture<RunResponse> run = pluginService.runWithDeadline(runRequest, DEADLINE_DEFAULT);
    RunResponse runResponse = run.get();

    assertThat(run.isDone()).isTrue();
    assertThat(runResponse.getReports().getDetectionReportsCount()).isEqualTo(numPluginsToTest);
    assertRunResponseContainsAllRunRequestParameters(runResponse, runRequest);
  }