openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.9k stars 3.59k forks source link

[solarman] Fix missing URL decoding in test #17782

Closed jlaur closed 4 days ago

jlaur commented 4 days ago

This test failed on my local Windows system due to having a space in my path.

url.getPath() here: https://github.com/openhab/openhab-addons/blob/12d3babc17f0ab83bbc82562543efc90ea0184e5/bundles/org.openhab.binding.solarman/src/test/java/org/openhab/binding/solarman/internal/DefinitionParserTest.java#L103

returns "/C:/Users/Jacob%20Laursen/Development/jlaur/openhab-addons/bundles/org.openhab.binding.solarman/target/classes/definitions" on my system.

java.io.File doesn't understand this encoding.

Did some minor additional refactoring as well.