@Test public void givenAWadlUri_whenSaveToFile_thenCreateZipWithWadlAndAllGrammars() throws Exception { doReturn(WADL_WITH_INCLUDE_GRAMMARS).when(httpClientMock).getAsString(new URI(WADL_URI)); wadlZipper.saveTo(httpClientMock, zipMock); final ArgumentCaptor<URI> uriArgument = ArgumentCaptor.forClass(URI.class); verify(httpClientMock, times(3)).getAsStream(uriArgument.capture()); assertThat(uriArgument.getAllValues(), contains(URI.create(REST_URI + '/' + RELATIVE_URI), URI.create(HOST_URI + ABSOLUTE_URI_WITHOUT_HOST), URI.create(ABSOLUTE_URI_WITH_HOST))); final ArgumentCaptor<String> nameArgument = ArgumentCaptor.forClass(String.class); verify(zipMock, times(4)).add(nameArgument.capture(), any(InputStream.class)); assertThat(nameArgument.getAllValues(), contains(DEFAULT_WADL_FILENAME, RELATIVE_URI + DEFAULT_SCHEMA_EXTENSION, ABSOLUTE_URI_WITHOUT_HOST.substring(1) + DEFAULT_SCHEMA_EXTENSION, ABSOLUTE_URI_WITH_HOST.substring(ABSOLUTE_URI_WITH_HOST.indexOf(" }
public void saveTo(String zipPathName) throws IOException, URISyntaxException { saveTo(new File(zipPathName)); }
WadlZipper { public void saveTo(String zipPathName) throws IOException, URISyntaxException { saveTo(new File(zipPathName)); } }
WadlZipper { public void saveTo(String zipPathName) throws IOException, URISyntaxException { saveTo(new File(zipPathName)); } WadlZipper(String wadlUri); }
WadlZipper { public void saveTo(String zipPathName) throws IOException, URISyntaxException { saveTo(new File(zipPathName)); } WadlZipper(String wadlUri); void saveTo(String zipPathName); void saveTo(File zipFile); }
WadlZipper { public void saveTo(String zipPathName) throws IOException, URISyntaxException { saveTo(new File(zipPathName)); } WadlZipper(String wadlUri); void saveTo(String zipPathName); void saveTo(File zipFile);  }