CalvalusFacade extends ProcessFacade { @Override public WpsProcess getProcessor(ProcessorNameConverter parser) throws WpsProcessorNotFoundException { return calvalusProcessorExtractor.getProcessor(parser, remoteUserName); } CalvalusFacade(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); ProductSet[] getProductSets(); Production getProduction(String jobId); String[] getRegionFiles(); String[][] loadRegionDataInfo(String url);  }
@Test public void testGetProcessor() throws Exception { ProcessorNameConverter mockParser = mock(ProcessorNameConverter.class); whenNew(CalvalusProcessorExtractor.class).withNoArguments().thenReturn(mockCalvalusProcessorExtractor); ArgumentCaptor<ProcessorNameConverter> parserCaptor = ArgumentCaptor.forClass(ProcessorNameConverter.class); ArgumentCaptor<String> userNameCaptor = ArgumentCaptor.forClass(String.class); calvalusFacade = new CalvalusFacade(mockRequestContext); calvalusFacade.getProcessor(mockParser); verify(mockCalvalusProcessorExtractor).getProcessor(parserCaptor.capture(), userNameCaptor.capture()); assertThat(parserCaptor.getValue(), equalTo(mockParser)); assertThat(userNameCaptor.getValue(), equalTo("mockUserName")); }