diff --git a/aem/aio_aem_events/pom.xml b/aem/aio_aem_events/pom.xml index b046b7f5..91cfc76d 100644 --- a/aem/aio_aem_events/pom.xml +++ b/aem/aio_aem_events/pom.xml @@ -22,7 +22,7 @@ com.adobe.aio.aem aio-aem ../pom.xml - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT aio-aem-events diff --git a/aem/core_aem/pom.xml b/aem/core_aem/pom.xml index 4a51701c..69836cdb 100644 --- a/aem/core_aem/pom.xml +++ b/aem/core_aem/pom.xml @@ -19,7 +19,7 @@ com.adobe.aio.aem aio-aem ../pom.xml - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT aio-aem-core diff --git a/aem/events_ingress_aem/pom.xml b/aem/events_ingress_aem/pom.xml index e1349650..25ca9e8f 100644 --- a/aem/events_ingress_aem/pom.xml +++ b/aem/events_ingress_aem/pom.xml @@ -19,7 +19,7 @@ com.adobe.aio.aem aio-aem ../pom.xml - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT aio-aem-events-publish diff --git a/aem/events_mgmt_aem/pom.xml b/aem/events_mgmt_aem/pom.xml index 503412a6..01aa2644 100644 --- a/aem/events_mgmt_aem/pom.xml +++ b/aem/events_mgmt_aem/pom.xml @@ -19,7 +19,7 @@ com.adobe.aio.aem aio-aem ../pom.xml - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT aio-aem-events-mgmt diff --git a/aem/events_osgi_mapping/pom.xml b/aem/events_osgi_mapping/pom.xml index 90142d56..3392ee01 100644 --- a/aem/events_osgi_mapping/pom.xml +++ b/aem/events_osgi_mapping/pom.xml @@ -19,7 +19,7 @@ com.adobe.aio.aem aio-aem ../pom.xml - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT aio-aem-events-osgi-mapping diff --git a/aem/lib_osgi/pom.xml b/aem/lib_osgi/pom.xml index 2d248934..b4f3d4fa 100644 --- a/aem/lib_osgi/pom.xml +++ b/aem/lib_osgi/pom.xml @@ -17,7 +17,7 @@ com.adobe.aio.aem aio-aem ../pom.xml - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT aio-lib-osgi diff --git a/aem/pom.xml b/aem/pom.xml index d9adfac8..3cc7a04d 100644 --- a/aem/pom.xml +++ b/aem/pom.xml @@ -19,7 +19,7 @@ com.adobe.aio aio-lib-java ../pom.xml - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT com.adobe.aio.aem diff --git a/core/pom.xml b/core/pom.xml index c95417b8..6df8405d 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -17,7 +17,7 @@ com.adobe.aio aio-lib-java - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml 4.0.0 diff --git a/core/src/main/java/com/adobe/aio/cloudevents/ZonedDateTimeDeserializer.java b/core/src/main/java/com/adobe/aio/cloudevents/ZonedDateTimeDeserializer.java new file mode 100644 index 00000000..b7cfbea8 --- /dev/null +++ b/core/src/main/java/com/adobe/aio/cloudevents/ZonedDateTimeDeserializer.java @@ -0,0 +1,35 @@ +/* + * Copyright 2023 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +package com.adobe.aio.cloudevents; + +import com.fasterxml.jackson.core.JacksonException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import java.io.IOException; +import java.time.DateTimeException; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; + +public class ZonedDateTimeDeserializer extends JsonDeserializer { + + @Override + public ZonedDateTime deserialize( + JsonParser jsonParser, DeserializationContext deserializationContext) + throws IOException, JacksonException { + try { + return ZonedDateTime.parse(jsonParser.getText(), DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } catch (DateTimeException e) { + throw new IllegalArgumentException("could not parse", e); + } + } +} diff --git a/core/src/main/java/com/adobe/aio/cloudevents/ZonedDateTimeSerializer.java b/core/src/main/java/com/adobe/aio/cloudevents/ZonedDateTimeSerializer.java new file mode 100644 index 00000000..a1de59e5 --- /dev/null +++ b/core/src/main/java/com/adobe/aio/cloudevents/ZonedDateTimeSerializer.java @@ -0,0 +1,31 @@ +/* + * Copyright 2023 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +package com.adobe.aio.cloudevents; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import java.io.IOException; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; + +public class ZonedDateTimeSerializer extends JsonSerializer { + + @Override + public void serialize( + ZonedDateTime zonedDateTime, + JsonGenerator jsonGenerator, + SerializerProvider serializerProvider) + throws IOException { + jsonGenerator.writeString(zonedDateTime.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)); + } +} \ No newline at end of file diff --git a/core/src/main/java/com/adobe/aio/util/JacksonUtil.java b/core/src/main/java/com/adobe/aio/util/JacksonUtil.java index 9febae2b..42ad80a8 100644 --- a/core/src/main/java/com/adobe/aio/util/JacksonUtil.java +++ b/core/src/main/java/com/adobe/aio/util/JacksonUtil.java @@ -11,6 +11,8 @@ */ package com.adobe.aio.util; +import com.adobe.aio.cloudevents.ZonedDateTimeDeserializer; +import com.adobe.aio.cloudevents.ZonedDateTimeSerializer; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -20,8 +22,6 @@ import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.node.TextNode; import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import io.cloudevents.json.ZonedDateTimeDeserializer; -import io.cloudevents.json.ZonedDateTimeSerializer; import io.openapitools.jackson.dataformat.hal.JacksonHALModule; import java.time.ZonedDateTime; import org.apache.commons.lang3.StringUtils; diff --git a/events_ingress/pom.xml b/events_ingress/pom.xml index 201b042d..3649aacc 100644 --- a/events_ingress/pom.xml +++ b/events_ingress/pom.xml @@ -17,7 +17,7 @@ com.adobe.aio aio-lib-java - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml 4.0.0 diff --git a/events_journal/pom.xml b/events_journal/pom.xml index 99014af0..78dbb9d3 100644 --- a/events_journal/pom.xml +++ b/events_journal/pom.xml @@ -17,7 +17,7 @@ com.adobe.aio aio-lib-java - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml 4.0.0 diff --git a/events_mgmt/pom.xml b/events_mgmt/pom.xml index 080cd338..22d9c1d5 100644 --- a/events_mgmt/pom.xml +++ b/events_mgmt/pom.xml @@ -17,7 +17,7 @@ com.adobe.aio aio-lib-java - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml 4.0.0 diff --git a/events_test/pom.xml b/events_test/pom.xml index 0939c283..f01bd949 100644 --- a/events_test/pom.xml +++ b/events_test/pom.xml @@ -16,7 +16,7 @@ com.adobe.aio aio-lib-java - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml 4.0.0 diff --git a/events_webhook/pom.xml b/events_webhook/pom.xml index 4ca46b6b..cc1dfd15 100644 --- a/events_webhook/pom.xml +++ b/events_webhook/pom.xml @@ -16,7 +16,7 @@ com.adobe.aio aio-lib-java - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml 4.0.0 diff --git a/events_webhook/src/test/java/com/adobe/aio/event/webhook/feign/FeignPubKeyServiceTest.java b/events_webhook/src/test/java/com/adobe/aio/event/webhook/feign/FeignPubKeyServiceTest.java index 8152da24..94045020 100644 --- a/events_webhook/src/test/java/com/adobe/aio/event/webhook/feign/FeignPubKeyServiceTest.java +++ b/events_webhook/src/test/java/com/adobe/aio/event/webhook/feign/FeignPubKeyServiceTest.java @@ -1,23 +1,20 @@ package com.adobe.aio.event.webhook.feign; -import java.io.File; -import java.security.KeyFactory; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockserver.model.HttpRequest.request; +import static org.mockserver.model.HttpResponse.response; + import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.PublicKey; - -import javax.crypto.KeyGenerator; - import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockserver.client.MockServerClient; import org.mockserver.junit.jupiter.MockServerExtension; import shaded_package.org.apache.commons.codec.binary.Base64; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockserver.model.HttpRequest.*; -import static org.mockserver.model.HttpResponse.*; - @ExtendWith(MockServerExtension.class) public class FeignPubKeyServiceTest { diff --git a/events_xdm/pom.xml b/events_xdm/pom.xml index 8ef32de0..61f03504 100644 --- a/events_xdm/pom.xml +++ b/events_xdm/pom.xml @@ -17,7 +17,7 @@ com.adobe.aio aio-lib-java - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml 4.0.0 diff --git a/ims/pom.xml b/ims/pom.xml index 5da83d0d..758275da 100644 --- a/ims/pom.xml +++ b/ims/pom.xml @@ -17,7 +17,7 @@ com.adobe.aio aio-lib-java - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index bb66a5b8..63e6d20a 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ com.adobe.aio aio-lib-java - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT pom @@ -96,15 +96,15 @@ 0.8.10 - 1.10.0 + 1.13.0 3.13.0 5.10.0 - 5.4.0 - 1.7.6 - 2.13.4 + 5.11.0 + 2.0.12 + 2.17.2 0.11.5 - 1.2.0 + 4.0.1 @@ -259,8 +259,8 @@ [3.3.9,) - Maven must be executed with a Java 8 JRE or higher. - 1.8.0 + Maven must be executed with a Java 17 JRE or higher. + 1.17.0