openhab / openhab-addons

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

[netatmo] NAPresenceCameraHandlerTest uses internal I18nProviderImpl class #7949

Closed wborn closed 4 years ago

wborn commented 4 years ago

When you build the ported OH3 add-ons, the build fails to compile the NAPresenceCameraHandlerTest class because the I18nProviderImpl constructor changed with https://github.com/openhab/openhab-core/pull/1487.

There should not be any usages of internal OHC/ESH classes in tests at all and it would be better if the build failed whenever they are used in imports.

Instead the NAPresenceCameraHandlerTest should use the TimeZoneProvider interface and use it with a mock for instance.

Can you have a look at this @Novanic? This import was added in https://github.com/openhab/openhab-addons/pull/7927.

Novanic commented 4 years ago

Ok, where/how can I execute the build? Is there a separated Git project?

wborn commented 4 years ago

You can port the add-ons using this script. But I don't think there's any need. Just remove the I18nProviderImpl from the imports and use something that implements the TimeZoneProvider instead. If that builds with OH2 it should also work with OH3. :-)

Novanic commented 4 years ago

Ok, thank you for the fast feedback.

The pull-request is now created, see https://github.com/openhab/openhab-addons/pull/7954

wborn commented 4 years ago

Thanks it works!