### Question:
GetAgendaServiceRequestProcessor extends AbstractServiceRequestProcessor<GetAgendaResponse, ServiceRequest<GetAgendaRequest>> { protected void retrieveExistingAgendaProgress(Agenda agenda, List<AgendaProgress> agendaProgresses) throws PersistenceException { logger.info("Attempting to lookup agendaProgressId={}", agenda.getProgressId()); DataObjectResponse<AgendaProgress> response = agendaProgressRequestProcessor.handleGET( new DefaultDataObjectRequest<>(null, agenda.getProgressId(), null)); boolean foundProgress = false; if(response.isError()) { logger.warn("Failed to look up agendaProgressId={} {}", agenda.getProgressId(), response.getErrorResponse().getDescription()); } else { AgendaProgress agendaProgress = response.getFirst(); if (agendaProgress != null && agendaProgress.getOperationProgress() != null) { if (Arrays.stream(agendaProgress.getOperationProgress()) .anyMatch(op -> ProcessingState.WAITING != op.getProcessingState())) { foundProgress = true; agendaProgresses.add(agendaProgress); } } } logger.info("{}Existing progress found for agendaId={}", foundProgress ? "" : "No ", agenda.getId()); } GetAgendaServiceRequestProcessor(ItemQueueFactory<AgendaInfo> agendaInfoItemQueueFactory, ObjectPersister<Insight> insightPersister,
        ObjectPersister<Agenda> agendaPersister, ObjectPersister<AgendaProgress> agendaProgressPersister, ObjectPersister<OperationProgress> operationProgressPersister); @Override GetAgendaResponse processPOST(ServiceRequest<GetAgendaRequest> serviceRequest); QueueResult<AgendaInfo> pollInsightQueue(Insight insight, int maxResults); RequestValidator<ServiceRequest<GetAgendaRequest>> getRequestValidator(); void setAgendaPersister(ObjectPersister<Agenda> agendaPersister); void setInsightRequestProcessor(InsightRequestProcessor insightRequestProcessor); void setAgendaInfoItemQueueFactory(ItemQueueFactory<AgendaInfo> agendaInfoItemQueueFactory);  }### Answer:
@Test(dataProvider = "withoutOperationProgressProvider") public void testRetrieveExistingAgendaProgressNoProgress(AgendaProgress agendaProgress) throws PersistenceException { doReturn(agendaProgress).when(mockAgendaProgressPersister).retrieve(AGENDA_PROGRESS_ID); List<AgendaProgress> agendaProgresses = new LinkedList<>(); processor.retrieveExistingAgendaProgress(createAgenda(AGENDA_PROGRESS_ID), agendaProgresses); Assert.assertEquals(agendaProgresses.size(), 0); }
@Test(dataProvider = "withOperationProgressProvider") public void testRetrieveExistingAgendaProgress(AgendaProgress agendaProgress) throws PersistenceException { DataObjectResponse<AgendaProgress> response = new DefaultDataObjectResponse<>(); response.add(agendaProgress); doReturn(response).when(mockAgendaProgressRequestProcessor).handleGET(any()); processor.setAgendaProgressRequestProcessor(mockAgendaProgressRequestProcessor); List<AgendaProgress> agendaProgresses = new ArrayList<>(); processor.retrieveExistingAgendaProgress(createAgenda(AGENDA_PROGRESS_ID), agendaProgresses); Assert.assertEquals(agendaProgresses.size(), 1); }