PipelineResources { public static List<String> detectClassPathResourcesToStage( ClassLoader classLoader, PipelineOptions options) { PipelineResourcesOptions artifactsRelatedOptions = options.as(PipelineResourcesOptions.class); List<String> detectedResources = artifactsRelatedOptions.getPipelineResourcesDetector().detect(classLoader); return detectedResources.stream().filter(isStageable()).collect(Collectors.toList()); }  static List<String> detectClassPathResourcesToStage(
      ClassLoader classLoader, PipelineOptions options); static List<String> prepareFilesForStaging(
      List<String> resourcesToStage, String tmpJarLocation);  }
@Test public void testDetectsResourcesToStage() throws IOException { File file = tmpFolder.newFile("file"); URLClassLoader classLoader = new URLClassLoader(new URL[] {file.toURI().toURL()}); PipelineResourcesOptions options = PipelineOptionsFactory.create().as(PipelineResourcesOptions.class); List<String> detectedResources = PipelineResources.detectClassPathResourcesToStage(classLoader, options); assertThat(detectedResources, not(empty())); }
@Test public void testDetectedResourcesListDoNotContainNotStageableResources() throws IOException { File unstageableResource = tmpFolder.newFolder(".gradle/wrapper/unstageableResource"); URLClassLoader classLoader = new URLClassLoader(new URL[] {unstageableResource.toURI().toURL()}); PipelineResourcesOptions options = PipelineOptionsFactory.create().as(PipelineResourcesOptions.class); List<String> detectedResources = PipelineResources.detectClassPathResourcesToStage(classLoader, options); assertThat(detectedResources, not(contains(unstageableResource.getAbsolutePath()))); }