Skip to content

Commit 31bfaf7

Browse files
authored
Add missing test for JarReader with trailing separator (#7929)
1 parent 9e8d0dc commit 31bfaf7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

telemetry/src/test/groovy/datadog/telemetry/dependency/JarReaderSpecification.groovy

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,25 @@ class JarReaderSpecification extends DepSpecification {
6868
result.manifest.getValue("Automatic-Module-Name") == "io.opentracing.util"
6969
}
7070

71+
void 'read nested jar with ending separator'() {
72+
given:
73+
String outerPath = getJar("spring-boot-app.jar").getAbsolutePath()
74+
String jarPath = "$outerPath!/BOOT-INF/lib/opentracing-util-0.33.0.jar!/"
75+
76+
when:
77+
def result = JarReader.readNestedJarFile(jarPath)
78+
79+
then:
80+
result.jarName == "opentracing-util-0.33.0.jar"
81+
result.pomProperties.size() == 1
82+
def properties = result.pomProperties['META-INF/maven/io.opentracing/opentracing-util/pom.properties']
83+
properties.groupId == "io.opentracing"
84+
properties.artifactId == "opentracing-util"
85+
properties.version == "0.33.0"
86+
result.manifest != null
87+
result.manifest.getValue("Automatic-Module-Name") == "io.opentracing.util"
88+
}
89+
7190
void 'non-existent simple jar'() {
7291
given:
7392
String jarPath = "non-existent.jar"

0 commit comments

Comments
 (0)