-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathReplaceJpountzLz4Spec.groovy
More file actions
41 lines (34 loc) · 1.31 KB
/
ReplaceJpountzLz4Spec.groovy
File metadata and controls
41 lines (34 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package nebula.plugin.resolutionrules
class ReplaceJpountzLz4Spec extends RulesBaseSpecification {
def setup() {
def ruleFile = new File(getClass().getResource('/replace-jpountz-lz4.json').toURI())
buildFile << """\
dependencies {
resolutionRules files('${ruleFile.absolutePath}')
}
""".stripIndent()
}
def 'check replacement works'() {
buildFile << '''\
dependencies {
implementation 'net.jpountz.lz4:lz4:latest.release'
implementation 'org.lz4:lz4-java:1.8.0'
}
'''.stripIndent()
when:
def result = runWithArgumentsSuccessfully('dependencies', '--configuration', 'compileClasspath')
then:
result.output.contains 'net.jpountz.lz4:lz4:latest.release -> org.lz4:lz4-java:'
}
def 'leaves net.jpountz.lz4 if org.lz4:lz4-java is not present'() {
buildFile << '''\
dependencies {
implementation 'net.jpountz.lz4:lz4:latest.release'
}
'''.stripIndent()
when:
def result = runWithArgumentsSuccessfully('dependencies', '--configuration', 'compileClasspath')
then:
!result.output.contains('net.jpountz.lz4:lz4:latest.release -> org.lz4:lz4-java:')
}
}