-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[awattar] Refactor and add test coverage #17752
[awattar] Refactor and add test coverage #17752
Conversation
@tl-photography - thanks. Did you intend to include the two commits from #17729? In that case, we need to add label "awaiting other PR" to mention this dependency. |
Ah ok, I marked it as draft only. Can I set this label too, otherwise please do so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for your work and your patience!
I just merged #17729 |
Thanks! PR should be good. 👍 Edit: Should I rebase? |
Yes, please. |
074b441
to
88312d1
Compare
done |
...ar/src/main/java/org/openhab/binding/awattar/internal/AwattarConsecutiveBestPriceResult.java
Outdated
Show resolved
Hide resolved
...nding.awattar/src/main/java/org/openhab/binding/awattar/internal/AwattarBestPriceResult.java
Outdated
Show resolved
Hide resolved
...ttar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBestPriceHandler.java
Outdated
Show resolved
Hide resolved
...ttar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBestPriceHandler.java
Outdated
Show resolved
Hide resolved
...ttar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBestPriceHandler.java
Outdated
Show resolved
Hide resolved
...tar/src/test/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandlerTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Thomas Leber <thomas@tl-photography.at>
Signed-off-by: Thomas Leber <thomas@tl-photography.at>
Signed-off-by: Thomas Leber <thomas@tl-photography.at>
Signed-off-by: Thomas Leber <thomas@tl-photography.at>
Signed-off-by: Thomas Leber <thomas@tl-photography.at>
Signed-off-by: Thomas Leber <thomas@tl-photography.at>
Signed-off-by: Thomas Leber <thomas@tl-photography.at>
c2c8b60
to
c5eec4e
Compare
i had conflicts and resolved them via rebase |
Signed-off-by: Thomas Leber <thomas@tl-photography.at>
I also added now tests for the refresh logic, since this was easy to add after the clock rework. |
In general, there is now the problem that the There are probably multiple ways to resolve this. I think first step would be to pass I think you can then separate the need for injecting the current time and the need for injecting the time-zone. So if you provide the I hope I'm not missing anything. |
....openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/AwattarUtil.java
Show resolved
Hide resolved
5684ebd
to
2f396fd
Compare
I introduced a new class, AwattarTimeProvider to abstract the usage of TimeZoneProvider and Clock, as well having a place to mock. This should address your concerns... i hope. |
Signed-off-by: Thomas Leber <thomas@tl-photography.at>
2f396fd
to
adde35c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, much cleaner! I have added a few minor comments, but overall looks good.
...ding.awattar/src/main/java/org/openhab/binding/awattar/internal/dto/AwattarTimeProvider.java
Show resolved
Hide resolved
...ding.awattar/src/main/java/org/openhab/binding/awattar/internal/dto/AwattarTimeProvider.java
Outdated
Show resolved
Hide resolved
...ding.awattar/src/main/java/org/openhab/binding/awattar/internal/dto/AwattarTimeProvider.java
Outdated
Show resolved
Hide resolved
...ding.awattar/src/main/java/org/openhab/binding/awattar/internal/dto/AwattarTimeProvider.java
Outdated
Show resolved
Hide resolved
...ding.awattar/src/main/java/org/openhab/binding/awattar/internal/dto/AwattarTimeProvider.java
Outdated
Show resolved
Hide resolved
...b.binding.awattar/src/test/java/org/openhab/binding/awattar/internal/api/AwattarApiTest.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/awattar/internal/AwattarNonConsecutiveBestPriceResult.java
Show resolved
Hide resolved
...binding.awattar/src/test/java/org/openhab/binding/awattar/internal/AwattarBestPriceTest.java
Outdated
Show resolved
Hide resolved
...binding.awattar/src/test/java/org/openhab/binding/awattar/internal/AwattarBestPriceTest.java
Outdated
Show resolved
Hide resolved
...ttar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBestPriceHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Thomas Leber <thomas@tl-photography.at>
Thanks for the suggestions, I added them with the last commit. If its good, then I would squash the commits together before merging. |
...ttar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBestPriceHandler.java
Outdated
Show resolved
Hide resolved
This is not needed, I will squash them when merging. 🙂 |
Signed-off-by: Thomas Leber <thomas@tl-photography.at>
...ding.awattar/src/main/java/org/openhab/binding/awattar/internal/dto/AwattarTimeProvider.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
...ttar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBestPriceHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Merci :) |
* [aWATTar] push test coverage and improve code readability Signed-off-by: Thomas Leber <thomas@tl-photography.at> Signed-off-by: chingon007 <tron81@gmx.de>
* [aWATTar] push test coverage and improve code readability Signed-off-by: Thomas Leber <thomas@tl-photography.at> Signed-off-by: Christian Koch <78686276+chilobo@users.noreply.github.com>
PR does not change behaviour.
Only pushes code coverage and code maintainability.