diff --git a/sdk-actors/src/test/java/io/dapr/actors/client/ActorProxyImplTest.java b/sdk-actors/src/test/java/io/dapr/actors/client/ActorProxyImplTest.java index d60388858..2855e0cd9 100644 --- a/sdk-actors/src/test/java/io/dapr/actors/client/ActorProxyImplTest.java +++ b/sdk-actors/src/test/java/io/dapr/actors/client/ActorProxyImplTest.java @@ -23,6 +23,8 @@ import org.mockito.Mockito; import reactor.core.publisher.Mono; +import java.time.ZonedDateTime; + import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.mock; @@ -467,6 +469,8 @@ static class MyData { private MyData myData; + private ZonedDateTime date; + public String getPropertyB() { return propertyB; @@ -499,6 +503,14 @@ public MyData getMyData() { public void setMyData(MyData myData) { this.myData = myData; } + + public ZonedDateTime getDate() { + return date; + } + + public void setDate(ZonedDateTime date) { + this.date = date; + } } } diff --git a/sdk/pom.xml b/sdk/pom.xml index 5f876e836..e53d3fb5a 100644 --- a/sdk/pom.xml +++ b/sdk/pom.xml @@ -149,6 +149,11 @@ grpc-inprocess test + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + 2.17.1 + diff --git a/sdk/src/main/java/io/dapr/client/ObjectSerializer.java b/sdk/src/main/java/io/dapr/client/ObjectSerializer.java index a131060b9..b1b69155e 100644 --- a/sdk/src/main/java/io/dapr/client/ObjectSerializer.java +++ b/sdk/src/main/java/io/dapr/client/ObjectSerializer.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.google.protobuf.MessageLite; import io.dapr.client.domain.CloudEvent; import io.dapr.utils.TypeRef; @@ -35,6 +36,7 @@ public class ObjectSerializer { */ protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .registerModule(new JavaTimeModule()) .setSerializationInclusion(JsonInclude.Include.NON_NULL); /**