test_class.declarator: testOutBaseDir = new File("target/test-out/OpearPackageMojoTest")
test_class.modifier: private final
test_class.original_string: private final File testOutBaseDir = new File("target/test-out/OpearPackageMojoTest");
test_class.type: File
test_class.var_name: testOutBaseDir
test_class.declarator: srcDir = new File("src/test/resources/OpearPackageMojoTest")
test_class.modifier: private final
test_class.original_string: private final File srcDir = new File("src/test/resources/OpearPackageMojoTest");
test_class.type: File
test_class.var_name: srcDir
test_class.file: maven/src/test/java/net/adamcin/oakpal/maven/mojo/OpearPackageMojoTest.java
test_class.identifier: OpearPackageMojoTest
test_case.body: @Test
      public void testGetEmbeddedLibraries() {
          final File testOutDir = new File(testOutBaseDir, "testGetEmbeddedLibraries");
          final OpearPackageMojo mojo = newMojo();
          final MavenProject project = mock(MavenProject.class);
          mojo.project = project;
          final MavenSession session = mock(MavenSession.class);
          mojo.session = session;
          final MavenExecutionRequest executionRequest = mock(MavenExecutionRequest.class);
          when(session.getRequest()).thenReturn(executionRequest);
          final RepositorySystem repositorySystem = mock(RepositorySystem.class);
          mojo.repositorySystem = repositorySystem;
  
          final String expectVersion = "0.31415926535898";
          final Dependency oakpalCoreDep = new DependencyFilter()
                  .withGroupId(OAKPAL_GROUP_ID)
                  .withArtifactId(OAKPAL_CORE_ARTIFACT_ID)
                  .withVersion(expectVersion)
                  .toDependency();
          final File oakpalDepFile = new File(testOutDir, "oakpal-core.jar");
          final Artifact oakpalArt = mock(Artifact.class);
          when(oakpalArt.getGroupId()).thenReturn(OAKPAL_GROUP_ID);
          when(oakpalArt.getArtifactId()).thenReturn(OAKPAL_CORE_ARTIFACT_ID);
          when(oakpalArt.getScope()).thenReturn("compile");
          when(oakpalArt.getFile()).thenReturn(oakpalDepFile);
  
          final Dependency importDep = new DependencyFilter().toDependency("import");
          final File importDepFile = new File(testOutDir, "import-scope.jar");
          final Artifact importArt = mock(Artifact.class);
          when(importArt.getGroupId()).thenReturn(OAKPAL_GROUP_ID);
          when(importArt.getArtifactId()).thenReturn("import-scope");
          when(importArt.getScope()).thenReturn("import");
          when(importArt.getFile()).thenReturn(importDepFile);
  
          final Dependency providedDep = new DependencyFilter().toDependency("provided");
          final File providedDepFile = new File(testOutDir, "provided-scope.jar");
          final Artifact providedArt = mock(Artifact.class);
          when(providedArt.getGroupId()).thenReturn(OAKPAL_GROUP_ID);
          when(providedArt.getArtifactId()).thenReturn("provided-scope");
          when(providedArt.getScope()).thenReturn("provided");
          when(providedArt.getFile()).thenReturn(providedDepFile);
  
          final Dependency testDep = new DependencyFilter().toDependency("test");
          final File testDepFile = new File(testOutDir, "test-scope.jar");
          final Artifact testArt = mock(Artifact.class);
          when(testArt.getGroupId()).thenReturn(OAKPAL_GROUP_ID);
          when(testArt.getArtifactId()).thenReturn("test-scope");
          when(testArt.getScope()).thenReturn("test");
          when(testArt.getFile()).thenReturn(testDepFile);
  
          final Dependency compileDep = new DependencyFilter().toDependency("compile");
          final File compileDepFile = new File(testOutDir, "compile-scope.jar");
          final Artifact compileArt = mock(Artifact.class);
          when(compileArt.getGroupId()).thenReturn(OAKPAL_GROUP_ID);
          when(compileArt.getArtifactId()).thenReturn("compile-scope");
          when(compileArt.getScope()).thenReturn("compile");
          when(compileArt.getFile()).thenReturn(compileDepFile);
  
          final Dependency runtimeDep = new DependencyFilter().toDependency("runtime");
          final File runtimeDepFile = new File(testOutDir, "runtime-scope.jar");
          final Artifact runtimeArt = mock(Artifact.class);
          when(runtimeArt.getGroupId()).thenReturn(OAKPAL_GROUP_ID);
          when(runtimeArt.getArtifactId()).thenReturn("runtime-scope");
          when(runtimeArt.getScope()).thenReturn("runtime");
          when(runtimeArt.getFile()).thenReturn(runtimeDepFile);
  
          final List<Dependency> projectDependencies =
                  Arrays.asList(oakpalCoreDep, importDep, providedDep, testDep, importDep,
                          compileDep, runtimeDep);
          when(project.getDependencies()).thenReturn(projectDependencies);
  
          doAnswer(call -> {
              final Dependency input = call.getArgument(0, Dependency.class);
              if (input == oakpalCoreDep) {
                  return oakpalArt;
              } else if (input == importDep) {
                  return importArt;
              } else if (input == providedDep) {
                  return providedArt;
              } else if (input == testDep) {
                  return testArt;
              } else if (input == compileDep) {
                  return compileArt;
              } else if (input == runtimeDep) {
                  return runtimeArt;
              } else {
                  return null;
              }
          }).when(repositorySystem).createDependencyArtifact(any(Dependency.class));
  
          doAnswer(call -> {
              final ArtifactResolutionRequest request = call.getArgument(0, ArtifactResolutionRequest.class);
              final ArtifactResolutionResult result = mock(ArtifactResolutionResult.class);
              when(result.getArtifacts()).thenReturn(Collections.singleton(request.getArtifact()));
              return result;
          }).when(repositorySystem).resolve(any(ArtifactResolutionRequest.class));
  
          final List<File> actualLibraries = mojo.getEmbeddedLibraries();
          assertFalse("not empty: " + actualLibraries, actualLibraries.isEmpty());
          assertEquals("expect files", Arrays.asList(compileDepFile, runtimeDepFile), actualLibraries);
  
      }
test_case.class_method_signature: OpearPackageMojoTest.testGetEmbeddedLibraries()
test_case.full_signature: @Test public void testGetEmbeddedLibraries()
test_case.identifier: testGetEmbeddedLibraries
test_case.invocations: newMojo mock mock mock thenReturn when getRequest mock toDependency withVersion withArtifactId withGroupId mock thenReturn when getGroupId thenReturn when getArtifactId thenReturn when getScope thenReturn when getFile toDependency mock thenReturn when getGroupId thenReturn when getArtifactId thenReturn when getScope thenReturn when getFile toDependency mock thenReturn when getGroupId thenReturn when getArtifactId thenReturn when getScope thenReturn when getFile toDependency mock thenReturn when getGroupId thenReturn when getArtifactId thenReturn when getScope thenReturn when getFile toDependency mock thenReturn when getGroupId thenReturn when getArtifactId thenReturn when getScope thenReturn when getFile toDependency mock thenReturn when getGroupId thenReturn when getArtifactId thenReturn when getScope thenReturn when getFile asList thenReturn when getDependencies createDependencyArtifact when doAnswer getArgument any resolve when doAnswer getArgument mock thenReturn when getArtifacts singleton getArtifact any getEmbeddedLibraries assertFalse isEmpty assertEquals asList
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetEmbeddedLibraries()
focal_class.declarator: OPEAR = "opear"
focal_class.modifier: public static final
focal_class.original_string: public static final String OPEAR = "opear";
focal_class.type: String
focal_class.var_name: OPEAR
focal_class.declarator: OAKPAL_GROUP_ID = "net.adamcin.oakpal"
focal_class.modifier: static final
focal_class.original_string: static final String OAKPAL_GROUP_ID = "net.adamcin.oakpal";
focal_class.type: String
focal_class.var_name: OAKPAL_GROUP_ID
focal_class.declarator: OAKPAL_API_ARTIFACT_ID = "oakpal-api"
focal_class.modifier: static final
focal_class.original_string: static final String OAKPAL_API_ARTIFACT_ID = "oakpal-api";
focal_class.type: String
focal_class.var_name: OAKPAL_API_ARTIFACT_ID
focal_class.declarator: OAKPAL_CORE_ARTIFACT_ID = "oakpal-core"
focal_class.modifier: static final
focal_class.original_string: static final String OAKPAL_CORE_ARTIFACT_ID = "oakpal-core";
focal_class.type: String
focal_class.var_name: OAKPAL_CORE_ARTIFACT_ID
focal_class.declarator: TEST_IS_OAKPAL_API =
              composeTest1(Artifact::getGroupId, OAKPAL_GROUP_ID::equals)
                      .and(composeTest1(Artifact::getArtifactId, OAKPAL_API_ARTIFACT_ID::equals))
focal_class.modifier: private static final
focal_class.original_string: private static final Predicate<Artifact> TEST_IS_OAKPAL_API =
              composeTest1(Artifact::getGroupId, OAKPAL_GROUP_ID::equals)
                      .and(composeTest1(Artifact::getArtifactId, OAKPAL_API_ARTIFACT_ID::equals));
focal_class.type: Predicate<Artifact>
focal_class.var_name: TEST_IS_OAKPAL_API
focal_class.declarator: TEST_IS_OAKPAL_CORE =
              composeTest1(Artifact::getGroupId, OAKPAL_GROUP_ID::equals)
                      .and(composeTest1(Artifact::getArtifactId, OAKPAL_CORE_ARTIFACT_ID::equals))
focal_class.modifier: private static final
focal_class.original_string: private static final Predicate<Artifact> TEST_IS_OAKPAL_CORE =
              composeTest1(Artifact::getGroupId, OAKPAL_GROUP_ID::equals)
                      .and(composeTest1(Artifact::getArtifactId, OAKPAL_CORE_ARTIFACT_ID::equals));
focal_class.type: Predicate<Artifact>
focal_class.var_name: TEST_IS_OAKPAL_CORE
focal_class.declarator: artifactHandlerManager
focal_class.modifier: @Component
focal_class.original_string: @Component
      ArtifactHandlerManager artifactHandlerManager;
focal_class.type: ArtifactHandlerManager
focal_class.var_name: artifactHandlerManager
focal_class.declarator: finalName
focal_class.modifier: @Parameter(defaultValue = "${project.build.finalName}", required = true)
focal_class.original_string: @Parameter(defaultValue = "${project.build.finalName}", required = true)
      String finalName;
focal_class.type: String
focal_class.var_name: finalName
focal_class.declarator: planFile
focal_class.modifier: @Parameter(defaultValue = "${project.build.directory}/oakpal-plugin/opear-plans/plan.json", required = true)
focal_class.original_string: @Parameter(defaultValue = "${project.build.directory}/oakpal-plugin/opear-plans/plan.json", required = true)
      File planFile;
focal_class.type: File
focal_class.var_name: planFile
focal_class.declarator: additionalPlans = new ArrayList<>()
focal_class.modifier: @Parameter
focal_class.original_string: @Parameter
      List<File> additionalPlans = new ArrayList<>();
focal_class.type: List<File>
focal_class.var_name: additionalPlans
focal_class.declarator: outputDirectory
focal_class.modifier: @Parameter(defaultValue = "${project.build.directory}", required = true)
focal_class.original_string: @Parameter(defaultValue = "${project.build.directory}", required = true)
      File outputDirectory;
focal_class.type: File
focal_class.var_name: outputDirectory
focal_class.file: maven/src/main/java/net/adamcin/oakpal/maven/mojo/OpearPackageMojo.java
focal_class.identifier: OpearPackageMojo
focal_class.class_method_signature: OpearPackageMojo.execute()
focal_class.full_signature: @Override public void execute()
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void execute()
focal_class.class_method_signature: OpearPackageMojo.attachArtifact(final @NotNull File finalFile)
focal_class.full_signature:  Artifact attachArtifact(final @NotNull File finalFile)
focal_class.identifier: attachArtifact
focal_class.parameters: (final @NotNull File finalFile)
focal_class.return: Artifact
focal_class.signature: Artifact attachArtifact(final @NotNull File finalFile)
focal_class.class_method_signature: OpearPackageMojo.getOwnVersion()
focal_class.full_signature:  String getOwnVersion()
focal_class.identifier: getOwnVersion
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getOwnVersion()
focal_class.class_method_signature: OpearPackageMojo.getBundleSymbolicName()
focal_class.full_signature:  String getBundleSymbolicName()
focal_class.identifier: getBundleSymbolicName
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getBundleSymbolicName()
focal_class.class_method_signature: OpearPackageMojo.getOakpalCoreVersion()
focal_class.full_signature:  String getOakpalCoreVersion()
focal_class.identifier: getOakpalCoreVersion
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getOakpalCoreVersion()
focal_class.class_method_signature: OpearPackageMojo.getEmbeddedLibraries()
focal_class.full_signature:  List<File> getEmbeddedLibraries()
focal_class.identifier: getEmbeddedLibraries
focal_class.parameters: ()
focal_class.return: List<File>
focal_class.signature: List<File> getEmbeddedLibraries()
focal_class.class_method_signature: OpearPackageMojo.assembleOpear()
focal_class.full_signature:  File assembleOpear()
focal_class.identifier: assembleOpear
focal_class.parameters: ()
focal_class.return: File
focal_class.signature: File assembleOpear()
focal_class.class_method_signature: OpearPackageMojo.mapDestFileNames(final @NotNull Map<String, T> acc,
                                                 final @NotNull List<T> files,
                                                 final @NotNull Function<T, String> namer)
focal_class.full_signature: static Map<String, T> mapDestFileNames(final @NotNull Map<String, T> acc,
                                                 final @NotNull List<T> files,
                                                 final @NotNull Function<T, String> namer)
focal_class.identifier: mapDestFileNames
focal_class.modifiers: static
focal_class.parameters: (final @NotNull Map<String, T> acc,
                                                 final @NotNull List<T> files,
                                                 final @NotNull Function<T, String> namer)
focal_class.return: Map<String, T>
focal_class.signature: Map<String, T> mapDestFileNames(final @NotNull Map<String, T> acc,
                                                 final @NotNull List<T> files,
                                                 final @NotNull Function<T, String> namer)
focal_class.class_method_signature: OpearPackageMojo.shrinkWrapPlans(final @NotNull File toDir)
focal_class.full_signature:  Result<List<String>> shrinkWrapPlans(final @NotNull File toDir)
focal_class.identifier: shrinkWrapPlans
focal_class.parameters: (final @NotNull File toDir)
focal_class.return: Result<List<String>>
focal_class.signature: Result<List<String>> shrinkWrapPlans(final @NotNull File toDir)
focal_class.class_method_signature: OpearPackageMojo.rewritePlan(final @NotNull File toDir,
                                    final @NotNull Map<URL, String> renamed,
                                    final @NotNull OakpalPlan plan,
                                    final @NotNull String filename)
focal_class.full_signature: static OakpalPlan rewritePlan(final @NotNull File toDir,
                                    final @NotNull Map<URL, String> renamed,
                                    final @NotNull OakpalPlan plan,
                                    final @NotNull String filename)
focal_class.identifier: rewritePlan
focal_class.modifiers: static
focal_class.parameters: (final @NotNull File toDir,
                                    final @NotNull Map<URL, String> renamed,
                                    final @NotNull OakpalPlan plan,
                                    final @NotNull String filename)
focal_class.return: OakpalPlan
focal_class.signature: OakpalPlan rewritePlan(final @NotNull File toDir,
                                    final @NotNull Map<URL, String> renamed,
                                    final @NotNull OakpalPlan plan,
                                    final @NotNull String filename)
focal_class.class_method_signature: OpearPackageMojo.copyPlans(final @NotNull File toDir, final @NotNull List<OakpalPlan> plans)
focal_class.full_signature: static Result<Map<String, OakpalPlan>> copyPlans(final @NotNull File toDir, final @NotNull List<OakpalPlan> plans)
focal_class.identifier: copyPlans
focal_class.modifiers: static
focal_class.parameters: (final @NotNull File toDir, final @NotNull List<OakpalPlan> plans)
focal_class.return: Result<Map<String, OakpalPlan>>
focal_class.signature: Result<Map<String, OakpalPlan>> copyPlans(final @NotNull File toDir, final @NotNull List<OakpalPlan> plans)
focal_class.class_method_signature: OpearPackageMojo.copyUrlStreams(final @NotNull File toDir,
                                                     final @NotNull List<URL> urls)
focal_class.full_signature: static Result<Map<URL, String>> copyUrlStreams(final @NotNull File toDir,
                                                     final @NotNull List<URL> urls)
focal_class.identifier: copyUrlStreams
focal_class.modifiers: static
focal_class.parameters: (final @NotNull File toDir,
                                                     final @NotNull List<URL> urls)
focal_class.return: Result<Map<URL, String>>
focal_class.signature: Result<Map<URL, String>> copyUrlStreams(final @NotNull File toDir,
                                                     final @NotNull List<URL> urls)
focal_class.superclass: extends AbstractCommonMojo
focal_method.body: List<File> getEmbeddedLibraries() {
          final Set<String> NOT_EMBEDDABLE = new HashSet<>(
                  Arrays.asList(Artifact.SCOPE_IMPORT, Artifact.SCOPE_PROVIDED, Artifact.SCOPE_TEST));
  
          final Set<File> embeddable = resolveArtifacts(project.getDependencies().stream()
                  .filter(composeTest1(Dependency::getScope, inSet(NOT_EMBEDDABLE).negate()))
                  .collect(Collectors.toList()), true).stream()
                  .filter(TEST_IS_OAKPAL_CORE.negate().and(TEST_IS_OAKPAL_API.negate()))
                  .map(Artifact::getFile)
                  .collect(Collectors.toCollection(LinkedHashSet::new));
  
          resolveArtifacts(project.getDependencies().stream()
                  .filter(new DependencyFilter().withGroupId(OAKPAL_GROUP_ID).withArtifactId(OAKPAL_CORE_ARTIFACT_ID))
                  .collect(Collectors.toList()), true).stream().map(Artifact::getFile).forEachOrdered(embeddable::remove);
  
          resolveArtifacts(project.getDependencies().stream()
                  .filter(new DependencyFilter().withGroupId(OAKPAL_GROUP_ID).withArtifactId(OAKPAL_API_ARTIFACT_ID))
                  .collect(Collectors.toList()), true).stream().map(Artifact::getFile).forEachOrdered(embeddable::remove);
  
          return new ArrayList<>(embeddable);
      }
focal_method.class_method_signature: OpearPackageMojo.getEmbeddedLibraries()
focal_method.full_signature:  List<File> getEmbeddedLibraries()
focal_method.identifier: getEmbeddedLibraries
focal_method.invocations: asList collect map filter stream resolveArtifacts collect filter stream getDependencies composeTest1 negate inSet toList and negate negate toCollection forEachOrdered map stream resolveArtifacts collect filter stream getDependencies withArtifactId withGroupId toList forEachOrdered map stream resolveArtifacts collect filter stream getDependencies withArtifactId withGroupId toList
focal_method.parameters: ()
focal_method.return: List<File>
focal_method.signature: List<File> getEmbeddedLibraries()