### Question:
AbstractNiFiProcessorsRestClient implements NiFiProcessorsRestClient { @Override public ProcessorDTO wakeUp(ProcessorDTO processor) { return findById(processor.getParentGroupId(), processor.getId()) .map(initState -> { ProcessorDTO current = initState; List<Function<ProcessorDTO, ProcessorDTO>> wakeSequence = generateWakeSequence(current); for (Function<ProcessorDTO, ProcessorDTO> transition : wakeSequence) { current = transition.apply(createProcessor(current)); } return current; }) .orElseThrow(() -> new NifiComponentNotFoundException(processor.getId(), NifiConstants.NIFI_COMPONENT_TYPE.PROCESSOR, null)); }  @Override ProcessorDTO schedule(NifiProcessorSchedule schedule); @Override ProcessorDTO wakeUp(ProcessorDTO processor);  }### Answer:
@Test public void wakeUp() { List<ProcessorDTO> processors = new ArrayList<>(); processors.add(newProcessor("cron-stopped", "STOPPED", NifiFeedConstants.SCHEDULE_STRATEGIES.CRON_DRIVEN.name(), "0 0 12 1/1 * ? *")); processors.add(newProcessor("cron-disabled", "DISABLED", NifiFeedConstants.SCHEDULE_STRATEGIES.CRON_DRIVEN.name(), "0 0 12 1/1 * ? *")); processors.add(newProcessor("cron-started", "RUNNING", NifiFeedConstants.SCHEDULE_STRATEGIES.CRON_DRIVEN.name(), "0 0 12 1/1 * ? *")); processors.add(newProcessor("timer-stopped", "STOPPED", NifiFeedConstants.SCHEDULE_STRATEGIES.TIMER_DRIVEN.name(), "5 min")); processors.add(newProcessor("timer-disabled", "DISABLED", NifiFeedConstants.SCHEDULE_STRATEGIES.TIMER_DRIVEN.name(), "5 min")); processors.add(newProcessor("timer-started", "RUNNING", NifiFeedConstants.SCHEDULE_STRATEGIES.TIMER_DRIVEN.name(), "5 min")); final NiFiProcessorsRestClient client = Mockito.mock(AbstractNiFiProcessorsRestClient.class, Mockito.CALLS_REAL_METHODS); Mockito.when(client.updateWithRetry(Mockito.any(ProcessorDTO.class), Mockito.anyInt(), Mockito.anyInt(), Mockito.any())).thenAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocationOnMock) throws Throwable { ProcessorDTO processorDTO = invocationOnMock.getArgumentAt(0, ProcessorDTO.class); return processorDTO; } }); processors.stream().forEach(processorDTO -> { Mockito.when(client.findById("parent", processorDTO.getId())).thenReturn(Optional.of(processorDTO)); ProcessorDTO wakeupDto = client.wakeUp(processorDTO); if (wakeupDto.getConfig() != null) { Assert.assertEquals(wakeupDto.getConfig().getSchedulingStrategy(), processorDTO.getConfig().getSchedulingStrategy()); Assert.assertEquals(wakeupDto.getConfig().getSchedulingPeriod(), processorDTO.getConfig().getSchedulingPeriod()); if (wakeupDto.getState() != null) { Assert.assertEquals(wakeupDto.getState(), processorDTO.getState()); } } }); }