mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-09-07 17:29:44 +02:00
Version: Fix getSopJavaVersion()
This commit is contained in:
parent
01be696f75
commit
04d154f63d
2 changed files with 8 additions and 2 deletions
|
@ -86,4 +86,10 @@ public class VersionTest extends AbstractSOPTest {
|
|||
throw new TestAbortedException("Implementation does not provide coverage for any sopv interface version.");
|
||||
}
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideInstances")
|
||||
public void sopJavaVersionTest(SOP sop) {
|
||||
assertNotNull(sop.version().getSopJavaVersion());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,12 +115,12 @@ interface Version {
|
|||
fun getSopJavaVersion(): String? {
|
||||
return try {
|
||||
val resourceIn: InputStream =
|
||||
javaClass.getResourceAsStream("/sop-java-version.properties")
|
||||
Version::class.java.getResourceAsStream("/sop-java-version.properties")
|
||||
?: throw IOException("File sop-java-version.properties not found.")
|
||||
val properties = Properties().apply { load(resourceIn) }
|
||||
properties.getProperty("sop-java-version")
|
||||
} catch (e: IOException) {
|
||||
null
|
||||
"DEVELOPMENT"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue