LocalFacade extends ProcessFacade { @Override public LocalProductionStatus orderProductionAsynchronous(Execute executeRequest) throws WpsProductionException { return localProduction.orderProductionAsynchronous(executeRequest, systemUserName, remoteUserName, wpsRequestContext, this); } 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 canOrderProductionAsynchronous() throws Exception { Execute mockExecute = mock(Execute.class); PowerMockito.whenNew(LocalProduction.class).withNoArguments().thenReturn(mockLocalProduction); ArgumentCaptor<Execute> executeCaptor = ArgumentCaptor.forClass(Execute.class); ArgumentCaptor<String> systemUserNameCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<String> remoteUserNameCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<WpsRequestContext> requestContextCaptor = ArgumentCaptor.forClass(WpsRequestContext.class); ArgumentCaptor<LocalFacade> localFacadeCaptor = ArgumentCaptor.forClass(LocalFacade.class); localFacade = new LocalFacade(mockRequestContext); localFacade.orderProductionAsynchronous(mockExecute); verify(mockLocalProduction).orderProductionAsynchronous(executeCaptor.capture(), systemUserNameCaptor.capture(), remoteUserNameCaptor.capture(), requestContextCaptor.capture(), localFacadeCaptor.capture()); assertThat(executeCaptor.getValue(), equalTo(mockExecute)); assertThat(systemUserNameCaptor.getValue(), equalTo("dummyUser")); assertThat(remoteUserNameCaptor.getValue(), equalTo("dummyUser")); assertThat(requestContextCaptor.getValue(), equalTo(mockRequestContext)); assertThat(localFacadeCaptor.getValue(), equalTo(localFacade)); }