@Test public void testTransportInternalSend() { TransportContext transportContext = TransportContext.builder().setBackendName("backendMock").build(); String testTransport = "testTransport"; TransportFactory factory = new TransportFactoryImpl( Collections.singleton(PROTOBUF_ENCODING), transportContext, transportInternalMock); Event<String> event = Event.ofTelemetry("TelemetryData"); Transformer<String, byte[]> transformer = String::getBytes; Transport<String> transport = factory.getTransport(testTransport, String.class, transformer); StatefulTransportScheduleCallback callback = new StatefulTransportScheduleCallback(); transport.schedule(event, callback); SendRequest request = SendRequest.builder() .setTransportContext(transportContext) .setEvent(event, PROTOBUF_ENCODING, transformer) .setTransportName(testTransport) .build(); verify(transportInternalMock, times(1)).send(request, callback); }
@Override public void send(SendRequest request, TransportScheduleCallback callback) { scheduler.schedule( request.getTransportContext().withPriority(request.getEvent().getPriority()), convert(request), callback); }
TransportRuntime implements TransportInternal { @Override public void send(SendRequest request, TransportScheduleCallback callback) { scheduler.schedule( request.getTransportContext().withPriority(request.getEvent().getPriority()), convert(request), callback); } }
TransportRuntime implements TransportInternal { @Override public void send(SendRequest request, TransportScheduleCallback callback) { scheduler.schedule( request.getTransportContext().withPriority(request.getEvent().getPriority()), convert(request), callback); } @Inject  TransportRuntime(
      @WallTime Clock eventClock,
      @Monotonic Clock uptimeClock,
      Scheduler scheduler,
      Uploader uploader,
      WorkInitializer initializer); }
TransportRuntime implements TransportInternal { @Override public void send(SendRequest request, TransportScheduleCallback callback) { scheduler.schedule( request.getTransportContext().withPriority(request.getEvent().getPriority()), convert(request), callback); } @Inject  TransportRuntime(
      @WallTime Clock eventClock,
      @Monotonic Clock uptimeClock,
      Scheduler scheduler,
      Uploader uploader,
      WorkInitializer initializer); static void initialize(Context applicationContext); static TransportRuntime getInstance(); @Deprecated TransportFactory newFactory(String backendName); TransportFactory newFactory(Destination destination); @RestrictTo(RestrictTo.Scope.LIBRARY) Uploader getUploader(); @Override void send(SendRequest request, TransportScheduleCallback callback); }
TransportRuntime implements TransportInternal { @Override public void send(SendRequest request, TransportScheduleCallback callback) { scheduler.schedule( request.getTransportContext().withPriority(request.getEvent().getPriority()), convert(request), callback); } @Inject  TransportRuntime(
      @WallTime Clock eventClock,
      @Monotonic Clock uptimeClock,
      Scheduler scheduler,
      Uploader uploader,
      WorkInitializer initializer); static void initialize(Context applicationContext); static TransportRuntime getInstance(); @Deprecated TransportFactory newFactory(String backendName); TransportFactory newFactory(Destination destination); @RestrictTo(RestrictTo.Scope.LIBRARY) Uploader getUploader(); @Override void send(SendRequest request, TransportScheduleCallback callback);  }