RpcNetworkConnectionsModel implements NetworkConnectionsModel { @NotNull @Override public ByteString requestBytes(@NotNull String id) { if (StringUtil.isEmpty(id)) { return ByteString.EMPTY; } BytesRequest request = BytesRequest.newBuilder() .setStreamId(mySession.getStreamId()) .setId(id) .build(); BytesResponse response = myTransportService.getBytes(request); return response.getContents(); } RpcNetworkConnectionsModel(@NotNull TransportServiceGrpc.TransportServiceBlockingStub transportService,
                                    @NotNull Common.Session session); @NotNull @Override List<HttpData> getData(@NotNull Range timeCurrentRangeUs); @NotNull @Override ByteString requestBytes(@NotNull String id);  }
@Test public void nonEmptyBytes() { myTransportService.addFile("dummyid", ByteString.copyFromUtf8("Dummy Contents")); assertThat(myModel.requestBytes("dummyid").toStringUtf8()).isEqualTo("Dummy Contents"); }
@Test public void notFoundBytes_ReturnsEmptyByteString() { assertThat(myModel.requestBytes("invalid id")).isEqualTo(ByteString.EMPTY); }