@Test public void should_load_all_routes_from_classpath() { final IstioAssistant istioAssistant = new IstioAssistant((istioClient)); final List<IstioResource> istioResources = istioAssistant.deployIstioResourcesFromClasspathPattern("route-rule-.*"); assertThat(istioResources) .hasSize(2); }
public List<IstioResource> deployIstioResourcesFromClasspathPattern(String pattern) { final List<IstioResource> istioResources = new ArrayList<>(); final FastClasspathScanner fastClasspathScanner = new FastClasspathScanner(); fastClasspathScanner.matchFilenamePattern(pattern, (FileMatchProcessor) (relativePath, inputStream, lengthBytes) -> { istioResources.addAll(deployIstioResources(inputStream)); inputStream.close(); }).scan(); return istioResources; }
IstioAssistant { public List<IstioResource> deployIstioResourcesFromClasspathPattern(String pattern) { final List<IstioResource> istioResources = new ArrayList<>(); final FastClasspathScanner fastClasspathScanner = new FastClasspathScanner(); fastClasspathScanner.matchFilenamePattern(pattern, (FileMatchProcessor) (relativePath, inputStream, lengthBytes) -> { istioResources.addAll(deployIstioResources(inputStream)); inputStream.close(); }).scan(); return istioResources; } }
IstioAssistant { public List<IstioResource> deployIstioResourcesFromClasspathPattern(String pattern) { final List<IstioResource> istioResources = new ArrayList<>(); final FastClasspathScanner fastClasspathScanner = new FastClasspathScanner(); fastClasspathScanner.matchFilenamePattern(pattern, (FileMatchProcessor) (relativePath, inputStream, lengthBytes) -> { istioResources.addAll(deployIstioResources(inputStream)); inputStream.close(); }).scan(); return istioResources; } IstioAssistant(IstioClient istioClient); }
IstioAssistant { public List<IstioResource> deployIstioResourcesFromClasspathPattern(String pattern) { final List<IstioResource> istioResources = new ArrayList<>(); final FastClasspathScanner fastClasspathScanner = new FastClasspathScanner(); fastClasspathScanner.matchFilenamePattern(pattern, (FileMatchProcessor) (relativePath, inputStream, lengthBytes) -> { istioResources.addAll(deployIstioResources(inputStream)); inputStream.close(); }).scan(); return istioResources; } IstioAssistant(IstioClient istioClient); List<IstioResource> deployIstioResources(final InputStream inputStream); void undeployIstioResources(final List<IstioResource> istioResources); List<IstioResource> deployIstioResources(final URL...urls); List<IstioResource> deployIstioResourcesFromClasspathPattern(String pattern); List<IstioResource> deployIstioResources(final Path directory); List<IstioResource> deployIstioResources(String content); void await(final URL url, Function<Response, Boolean> checker); void await(final Request request, Function<Response, Boolean> checker); }
IstioAssistant { public List<IstioResource> deployIstioResourcesFromClasspathPattern(String pattern) { final List<IstioResource> istioResources = new ArrayList<>(); final FastClasspathScanner fastClasspathScanner = new FastClasspathScanner(); fastClasspathScanner.matchFilenamePattern(pattern, (FileMatchProcessor) (relativePath, inputStream, lengthBytes) -> { istioResources.addAll(deployIstioResources(inputStream)); inputStream.close(); }).scan(); return istioResources; } IstioAssistant(IstioClient istioClient); List<IstioResource> deployIstioResources(final InputStream inputStream); void undeployIstioResources(final List<IstioResource> istioResources); List<IstioResource> deployIstioResources(final URL...urls); List<IstioResource> deployIstioResourcesFromClasspathPattern(String pattern); List<IstioResource> deployIstioResources(final Path directory); List<IstioResource> deployIstioResources(String content); void await(final URL url, Function<Response, Boolean> checker); void await(final Request request, Function<Response, Boolean> checker);  }