diff options
| author | mo khan <mo.khan@gmail.com> | 2020-03-16 15:03:49 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-03-18 10:29:38 -0600 |
| commit | 1fe18f5829a76deeee734eb54cac292d3567ea1d (patch) | |
| tree | 9c5bd41c0f3e51ac785f37071e6089f4bd25e990 /spec/integration | |
| parent | 63d162327bb2c90e3a2b2278f723de25e7c23467 (diff) | |
Add spec to test pulling a package from a custom repository
Diffstat (limited to 'spec/integration')
| -rw-r--r-- | spec/integration/java/maven_spec.rb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/spec/integration/java/maven_spec.rb b/spec/integration/java/maven_spec.rb index 6e1752f..32ac7e9 100644 --- a/spec/integration/java/maven_spec.rb +++ b/spec/integration/java/maven_spec.rb @@ -2,4 +2,50 @@ require 'spec_helper' RSpec.describe "maven" do include_examples "each report version", "java", "maven" + + describe "When the maven dependencies come from a custom public maven repository" do + it 'is able to detect some of the licenses' do + runner.add_file('pom.xml') do +<<~XML +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>com.gitlab.secure</groupId> + <artifactId>license-scanning</artifactId> + <packaging>jar</packaging> + <version>1.0-SNAPSHOT</version> + <name>example</name> + <url>http://maven.apache.org</url> + <dependencies> + <dependency> + <groupId>com.gitlab.xlgmokha</groupId> + <artifactId>mvn-spike</artifactId> + <version>1.1-SNAPSHOT</version> + </dependency> + </dependencies> + <repositories> + <repository> + <id>gitlab-maven</id> + <url>https://gitlab.com/api/v4/projects/17523603/packages/maven</url> + </repository> + </repositories> + <distributionManagement> + <repository> + <id>gitlab-maven</id> + <url>https://gitlab.com/api/v4/projects/17523603/packages/maven</url> + </repository> + <snapshotRepository> + <id>gitlab-maven</id> + <url>https://gitlab.com/api/v4/projects/17523603/packages/maven</url> + </snapshotRepository> + </distributionManagement> +</project> +XML + end + + report = runner.scan + + expect(report).to match_schema(version: '2.0') + expect(report[:dependencies]).to match_array([{ name: 'mvn-spike', url: '', description: '', paths: ['.'], licenses: ['unknown'] }]) + end + end end |
