LocalFacade extends ProcessFacade { @Override public WpsProcess getProcessor(ProcessorNameConverter parser) throws WpsProcessorNotFoundException { return processorExtractor.getProcessor(parser, remoteUserName); } LocalFacade(WpsRequestContext wpsRequestContext); @Override LocalProductionStatus orderProductionAsynchronous(Execute executeRequest); @Override LocalProductionStatus orderProductionSynchronous(Execute executeRequest); @Override List<String> getProductResultUrls(String jobId); @Override void stageProduction(String jobId); @Override void observeStagingStatus(String jobId); @Override void generateProductMetadata(String jobId); @Override List<WpsProcess> getProcessors(); @Override WpsProcess getProcessor(ProcessorNameConverter parser);  }
@Test public void canGetProcessor() throws Exception { PowerMockito.whenNew(LocalProcessorExtractor.class).withNoArguments().thenReturn(mockProcessorExtractor); ProcessorNameConverter mockConverter = mock(ProcessorNameConverter.class); ArgumentCaptor<ProcessorNameConverter> converterCaptor = ArgumentCaptor.forClass(ProcessorNameConverter.class); ArgumentCaptor<String> userNameCaptor = ArgumentCaptor.forClass(String.class); localFacade = new LocalFacade(mockRequestContext); localFacade.getProcessor(mockConverter); verify(mockProcessorExtractor).getProcessor(converterCaptor.capture(), userNameCaptor.capture()); assertThat(converterCaptor.getValue(), equalTo(mockConverter)); assertThat(userNameCaptor.getValue(), equalTo("dummyUser")); }