LocalFacade extends ProcessFacade { @Override public void generateProductMetadata(String jobId) throws ProductMetadataException { localStaging.generateProductMetadata(jobId, remoteUserName, hostName, portNumber); } 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 canGenerateProductMetadata() throws Exception { PowerMockito.whenNew(LocalStaging.class).withNoArguments().thenReturn(mockLocalStaging); ArgumentCaptor<String> jobIdCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<String> userNameCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<String> hostNameCaptor = ArgumentCaptor.forClass(String.class); ArgumentCaptor<Integer> portNumberCaptor = ArgumentCaptor.forClass(Integer.class); localFacade = new LocalFacade(mockRequestContext); localFacade.generateProductMetadata(DUMMY_JOB_ID); verify(mockLocalStaging).generateProductMetadata(jobIdCaptor.capture(), userNameCaptor.capture(), hostNameCaptor.capture(), portNumberCaptor.capture()); assertThat(jobIdCaptor.getValue(), equalTo("job-00")); assertThat(userNameCaptor.getValue(), equalTo("dummyUser")); assertThat(hostNameCaptor.getValue(), equalTo("www.dummy-host.de")); assertThat(portNumberCaptor.getValue(), equalTo(80)); }