diff options
| author | mo khan <mo.khan@gmail.com> | 2020-11-10 01:30:35 +0000 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-11-10 01:30:35 +0000 |
| commit | 1bc270fea3b352b44dfcef3fe16e97a2bbd4d7a5 (patch) | |
| tree | 8f61c9dccbd468de456e516113e9d6f289a7a157 /spec/integration/java | |
| parent | f8200b265f63173c9b8d0b26470b449f512dbd17 (diff) | |
| parent | 82338d974f42149e70f9163567940453f8f18b79 (diff) | |
Merge branch '273155-recursive' into 'main'v3.28.2
Detect maven/gradle wrapper in sub directory
See merge request gitlab-org/security-products/analyzers/license-finder!15
Diffstat (limited to 'spec/integration/java')
| -rw-r--r-- | spec/integration/java/gradle_spec.rb | 15 | ||||
| -rw-r--r-- | spec/integration/java/maven_spec.rb | 71 |
2 files changed, 86 insertions, 0 deletions
diff --git a/spec/integration/java/gradle_spec.rb b/spec/integration/java/gradle_spec.rb index 108c915..852d19e 100644 --- a/spec/integration/java/gradle_spec.rb +++ b/spec/integration/java/gradle_spec.rb @@ -171,4 +171,19 @@ plugins { end end end + + context "when scanning gradle project in a sub directory" do + let(:env) do + { + 'LICENSE_FINDER_CLI_OPTS' => '--project-path=service/gradle-backend' + } + end + + before do + runner.mount(dir: fixture_file('java/gradle/nested')) + end + + specify { expect(subject).to match_schema } + specify { expect(subject.dependency_names).to match_array(["postgresql"]) } + end end diff --git a/spec/integration/java/maven_spec.rb b/spec/integration/java/maven_spec.rb index 72fec6d..7d4896b 100644 --- a/spec/integration/java/maven_spec.rb +++ b/spec/integration/java/maven_spec.rb @@ -142,4 +142,75 @@ RSpec.describe "maven" do end end end + + context "when scanning maven project in a sub directory" do + let(:env) do + { + 'LICENSE_FINDER_CLI_OPTS' => '--project-path=service/maven-backend' + } + end + + before do + runner.mount(dir: fixture_file('java/maven/nested')) + end + + specify { expect(subject).to match_schema } + + specify do + expect(subject.dependency_names).to match_array([ + "accessors-smart", + "android-json", + "annotations", + "apiguardian-api", + "asm", + "assertj-core", + "byte-buddy", + "byte-buddy-agent", + "hamcrest", + "jakarta.activation-api", + "jakarta.annotation-api", + "jakarta.xml.bind-api", + "json-path", + "json-smart", + "jsonassert", + "jul-to-slf4j", + "junit-jupiter", + "junit-jupiter-api", + "junit-jupiter-engine", + "junit-jupiter-params", + "junit-platform-commons", + "junit-platform-engine", + "kotlin-reflect", + "kotlin-stdlib", + "kotlin-stdlib-common", + "kotlin-stdlib-jdk7", + "kotlin-stdlib-jdk8", + "log4j-api", + "log4j-to-slf4j", + "logback-classic", + "logback-core", + "mockito-core", + "mockito-junit-jupiter", + "objenesis", + "opentest4j", + "slf4j-api", + "snakeyaml", + "spring-aop", + "spring-beans", + "spring-boot", + "spring-boot-autoconfigure", + "spring-boot-starter", + "spring-boot-starter-logging", + "spring-boot-starter-test", + "spring-boot-test", + "spring-boot-test-autoconfigure", + "spring-context", + "spring-core", + "spring-expression", + "spring-jcl", + "spring-test", + "xmlunit-core" + ]) + end + end end |
