]> git.basschouten.com Git - openhab-addons.git/commit
[dynamodb] Fixed persistence issues with zoneddatetime (#9157)
authorSami Salonen <ssalonen@gmail.com>
Sun, 29 Nov 2020 10:24:16 +0000 (12:24 +0200)
committerGitHub <noreply@github.com>
Sun, 29 Nov 2020 10:24:16 +0000 (11:24 +0100)
commit5d60d6464b5731cd940293d4ba63ce4f195f5e4e
treebed8e1ee8e8e1fd767d70479b3e76f5349e09d82
parent852f19f5c29230f39443b21522c7f53a4863e836
[dynamodb] Fixed persistence issues with zoneddatetime (#9157)

* [dynamodb] fix serialization of ZonedDateTime timestamps

Resolves #9156.

AWS SDK does not know how to serialize ZonedDateTime. We resolve this
by providing explicit serializer/deserializer.

In addition, integration tests had issue with timezones. The persistence
converts all timestamps from the DynamoDB to system timezone for display
purposes. This was not taken into account in the tests and failure was
expected with non-UTC system timezone.

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
bundles/org.openhab.persistence.dynamodb/src/main/java/org/openhab/persistence/dynamodb/internal/AbstractDynamoDBItem.java
bundles/org.openhab.persistence.dynamodb/src/main/java/org/openhab/persistence/dynamodb/internal/DynamoDBBigDecimalItem.java
bundles/org.openhab.persistence.dynamodb/src/main/java/org/openhab/persistence/dynamodb/internal/DynamoDBHistoricItem.java
bundles/org.openhab.persistence.dynamodb/src/main/java/org/openhab/persistence/dynamodb/internal/DynamoDBStringItem.java
bundles/org.openhab.persistence.dynamodb/src/test/java/org/openhab/persistence/dynamodb/internal/DateTimeItemIntegrationTest.java