@Test(dataProvider = "percentCompleteProvider") public void testGetPercentComplete(List<AgendaProgress> progressList, final double EXPECTED_VALUE) { Assert.assertEquals(progressSummaryRequestProcessor.getPercentComplete(progressList), EXPECTED_VALUE); }
protected double getPercentComplete(List<AgendaProgress> progressList) { if(progressList == null || progressList.size() == 0) return 0d; return Math.min(100, progressList.stream().filter(ap -> ap.getPercentComplete() != null).mapToDouble(AgendaProgress::getPercentComplete).sum() / progressList.size()); }
ProgressSummaryRequestProcessor extends AbstractServiceRequestProcessor<ProgressSummaryResponse, ServiceRequest<ProgressSummaryRequest>> { protected double getPercentComplete(List<AgendaProgress> progressList) { if(progressList == null || progressList.size() == 0) return 0d; return Math.min(100, progressList.stream().filter(ap -> ap.getPercentComplete() != null).mapToDouble(AgendaProgress::getPercentComplete).sum() / progressList.size()); } }
ProgressSummaryRequestProcessor extends AbstractServiceRequestProcessor<ProgressSummaryResponse, ServiceRequest<ProgressSummaryRequest>> { protected double getPercentComplete(List<AgendaProgress> progressList) { if(progressList == null || progressList.size() == 0) return 0d; return Math.min(100, progressList.stream().filter(ap -> ap.getPercentComplete() != null).mapToDouble(AgendaProgress::getPercentComplete).sum() / progressList.size()); } protected  ProgressSummaryRequestProcessor();  ProgressSummaryRequestProcessor(ObjectPersister<AgendaProgress> agendaProgressPersister,
        ObjectPersister<OperationProgress> operationProgressPersister, ObjectPersister<Agenda> agendaPersister); }
ProgressSummaryRequestProcessor extends AbstractServiceRequestProcessor<ProgressSummaryResponse, ServiceRequest<ProgressSummaryRequest>> { protected double getPercentComplete(List<AgendaProgress> progressList) { if(progressList == null || progressList.size() == 0) return 0d; return Math.min(100, progressList.stream().filter(ap -> ap.getPercentComplete() != null).mapToDouble(AgendaProgress::getPercentComplete).sum() / progressList.size()); } protected  ProgressSummaryRequestProcessor();  ProgressSummaryRequestProcessor(ObjectPersister<AgendaProgress> agendaProgressPersister,
        ObjectPersister<OperationProgress> operationProgressPersister, ObjectPersister<Agenda> agendaPersister); @Override ProgressSummaryResponse processPOST(ServiceRequest<ProgressSummaryRequest> serviceRequest); void setAgendaProgressClient(ObjectClient<AgendaProgress> agendaProgressClient); ProgressSummaryRequestProcessor setVisibilityFilter(
        VisibilityFilter<AgendaProgress, ServiceRequest<ProgressSummaryRequest>> visibilityFilter); }
ProgressSummaryRequestProcessor extends AbstractServiceRequestProcessor<ProgressSummaryResponse, ServiceRequest<ProgressSummaryRequest>> { protected double getPercentComplete(List<AgendaProgress> progressList) { if(progressList == null || progressList.size() == 0) return 0d; return Math.min(100, progressList.stream().filter(ap -> ap.getPercentComplete() != null).mapToDouble(AgendaProgress::getPercentComplete).sum() / progressList.size()); } protected  ProgressSummaryRequestProcessor();  ProgressSummaryRequestProcessor(ObjectPersister<AgendaProgress> agendaProgressPersister,
        ObjectPersister<OperationProgress> operationProgressPersister, ObjectPersister<Agenda> agendaPersister); @Override ProgressSummaryResponse processPOST(ServiceRequest<ProgressSummaryRequest> serviceRequest); void setAgendaProgressClient(ObjectClient<AgendaProgress> agendaProgressClient); ProgressSummaryRequestProcessor setVisibilityFilter(
        VisibilityFilter<AgendaProgress, ServiceRequest<ProgressSummaryRequest>> visibilityFilter);  }