FederatedRepositoryImpl implements FederatedRepository { @Override public Observable<Boolean> uploadGradient(byte[] gradient) { return networkDataSource.sendGradient(gradient); } FederatedRepositoryImpl(FederatedDataSource dataSource, FederatedNetworkDataSource networkDataSource); @Override FederatedDataSet getTrainingData(); @Override FederatedDataSet getTestData(); @Override FederatedDataSet getCrossValidationData(); @Override Observable<Boolean> uploadGradient(byte[] gradient); @Override Observable<byte[]> retrieveGradient(); @Override Observable<Integer> registerModel();  }
@Test public void testGradientIsSentToServer() { byte[] gradient = new byte[]{}; cut.uploadGradient(gradient); verify(networkDataSource).sendGradient(gradient); }