TrainerPresenter implements UseCaseCallback<FederatedRepository> { public void retrieveData() { UseCase useCase = new GetTrainingData(this, repository); executor.execute(useCase); } @Inject  TrainerPresenter(TrainerView view,
                            ModelConfiguration modelConfiguration,
                            FederatedRepository repository,
                            UseCaseExecutor executor,
                            UseCaseThreadExecutor threadExecutor,
                            @Named("dataset_splits")
                            int dataSetSplits); void retrieveData(); @Override void onSuccess(FederatedRepository result); @Override void onError(UseCaseError error); void sendGradient(); void getUpdatedGradient(); void trainNewModel(); void predict();  }
@Test public void testGetTrainingDataIsPassedToTheView() { int numberClients = 3; UseCaseExecutor executor = mock(UseCaseExecutor.class); FederatedRepository repository = mock(FederatedRepository.class); TrainerView view = mock(TrainerView.class); ModelConfiguration modelConfiguration = mock(ModelConfiguration.class); UseCaseThreadExecutor threadExecutor = mock(UseCaseThreadExecutor.class); TrainerPresenter cut = new TrainerPresenter(view, modelConfiguration, repository, executor, threadExecutor, numberClients); cut.retrieveData(); Mockito.verify(executor).execute(any(GetTrainingData.class)); }