3 describe 'archive::nexus' do
4 let(:facts) { { os: { family: 'RedHat' }, puppetversion: '4.4.0' } }
6 context 'nexus archive with defaults' do
7 let(:title) { '/tmp/hawtio.war' }
11 url: 'https://oss.sonatype.org',
12 gav: 'io.hawt:hawtio-web:1.4.36',
13 repository: 'releases',
19 is_expected.to contain_archive('/tmp/hawtio.war').with(
20 source: 'https://oss.sonatype.org/service/local/artifact/maven/content?g=io.hawt&a=hawtio-web&v=1.4.36&r=releases&p=war',
21 checksum_url: 'https://oss.sonatype.org/service/local/artifact/maven/content?g=io.hawt&a=hawtio-web&v=1.4.36&r=releases&p=war.md5'
26 is_expected.to contain_file('/tmp/hawtio.war').that_requires('Archive[/tmp/hawtio.war]').with(
33 context 'nexus archive with overwritten parameters' do
34 let(:title) { '/tmp/artifact.war' }
38 url: 'https://oss.sonatype.org',
39 gav: 'io.hawt:hawtio-web:1.4.36',
40 repository: 'releases',
46 creates: '/opt/artifact/WEB-INF',
52 is_expected.to contain_archive('/tmp/artifact.war').with(
56 'extract_path' => '/opt',
57 'creates' => '/opt/artifact/WEB-INF',
63 is_expected.to contain_file('/tmp/artifact.war').that_requires('Archive[/tmp/artifact.war]').with(
70 context 'nexus archive with checksum_verify => false' do
77 url: 'https://oss.sonatype.org',
78 gav: 'io.hawt:hawtio-web:1.4.36',
79 repository: 'releases',
85 creates: '/opt/artifact/WEB-INF',
87 checksum_verify: false
92 is_expected.to contain_archive('/tmp/artifact.war').with(
96 'extract_path' => '/opt',
97 'creates' => '/opt/artifact/WEB-INF',
99 'checksum_verify' => false
104 is_expected.to contain_file('/tmp/artifact.war').that_requires('Archive[/tmp/artifact.war]').with(
110 context 'nexus archive with allow_insecure => true' do
111 let(:title) { '/tmp/artifact.war' }
115 url: 'https://oss.sonatype.org',
116 gav: 'io.hawt:hawtio-web:1.4.36',
117 repository: 'releases',
123 it { is_expected.to contain_archive('/tmp/artifact.war').with_allow_insecure(true) }
125 context 'nexus archive with allow_insecure => false' do
126 let(:title) { '/tmp/artifact.war' }
130 url: 'https://oss.sonatype.org',
131 gav: 'io.hawt:hawtio-web:1.4.36',
132 repository: 'releases',
134 allow_insecure: false
138 it { is_expected.to contain_archive('/tmp/artifact.war').with_allow_insecure(false) }
140 context 'nexus archive with allow_insecure => \'foobar\'' do
141 let(:title) { '/tmp/artifact.war' }
145 url: 'https://oss.sonatype.org',
146 gav: 'io.hawt:hawtio-web:1.4.36',
147 repository: 'releases',
149 allow_insecure: 'foobar'
153 it { is_expected.to compile.and_raise_error(%r{parameter 'allow_insecure' expects a value of type Undef or Boolean, got String}) }
155 context 'nexus archive with use_nexus3_urls => false' do
156 let(:title) { '/tmp/artifact.war' }
160 url: 'https://oss.sonatype.org',
161 gav: 'io.hawt:hawtio-web:1.4.36',
162 repository: 'releases',
164 use_nexus3_urls: false
168 it { is_expected.to contain_archive('/tmp/artifact.war').with_source('https://oss.sonatype.org/service/local/artifact/maven/content?g=io.hawt&a=hawtio-web&v=1.4.36&r=releases&p=war') }
170 context 'nexus archive with use_nexus3_urls => true' do
171 let(:title) { '/tmp/artifact.war' }
175 url: 'https://oss.sonatype.org',
176 gav: 'io.hawt:hawtio-web:1.4.36',
177 repository: 'releases',
179 use_nexus3_urls: true
183 it { is_expected.to contain_archive('/tmp/artifact.war').with_source('https://oss.sonatype.org/repository/releases/io/hawt/hawtio-web/1.4.36/hawtio-web-1.4.36.war') }