diff --git a/tck/src/main/java/org/eclipse/microprofile/config/tck/ConverterTest.java b/tck/src/main/java/org/eclipse/microprofile/config/tck/ConverterTest.java
index 61012e3..04ad918 100644
--- a/tck/src/main/java/org/eclipse/microprofile/config/tck/ConverterTest.java
+++ b/tck/src/main/java/org/eclipse/microprofile/config/tck/ConverterTest.java
@@ -20,9 +20,12 @@
package org.eclipse.microprofile.config.tck;
import java.time.Duration;
+import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
import javax.inject.Inject;
@@ -47,6 +50,7 @@
/**
* @author Mark Struberg
+ * @author Emily Jiang
*/
public class ConverterTest extends Arquillian {
@@ -167,6 +171,38 @@ public void testLocalDateTime_Broken() {
LocalDateTime value = config.getValue("tck.config.test.javaconfig.converter.localdatetimevalue.broken", LocalDateTime.class);
}
+ @Test
+ public void testOffsetDateTime() {
+ OffsetDateTime value = config.getValue("tck.config.test.javaconfig.converter.offsetdatetimevalue", OffsetDateTime.class);
+ Assert.assertEquals(value, OffsetDateTime.parse("2007-12-03T10:15:30+01:00"));
+ }
+
+ @Test(expectedExceptions = IllegalArgumentException.class)
+ public void testOffsetDateTime_Broken() {
+ OffsetDateTime value = config.getValue("tck.config.test.javaconfig.converter.offsetdatetimevalue.broken", OffsetDateTime.class);
+ }
+
+ @Test
+ public void testOffsetTime() {
+ OffsetTime value = config.getValue("tck.config.test.javaconfig.converter.offsettimevalue", OffsetTime.class);
+ Assert.assertEquals(value, OffsetTime.parse("13:45.30.123456789+02:00"));
+ }
+
+ @Test(expectedExceptions = IllegalArgumentException.class)
+ public void testOffsetTime_Broken() {
+ OffsetTime value = config.getValue("tck.config.test.javaconfig.converter.offsettimevalue.broken", OffsetTime.class);
+ }
+
+ @Test
+ public void testInstant() {
+ Instant value = config.getValue("tck.config.test.javaconfig.converter.instantvalue", Instant.class);
+ Assert.assertEquals(value, Instant.parse("2015-06-02T21:34:33.616Z"));
+ }
+
+ @Test(expectedExceptions = IllegalArgumentException.class)
+ public void testInstant_Broken() {
+ Instant value = config.getValue("tck.config.test.javaconfig.converter.instantvalue.broken", Instant.class);
+ }
@Test
public void testBoolean() {
diff --git a/tck/src/main/resources/internal/META-INF/microprofile-config.properties b/tck/src/main/resources/internal/META-INF/microprofile-config.properties
index a30f2c3..287074f 100644
--- a/tck/src/main/resources/internal/META-INF/microprofile-config.properties
+++ b/tck/src/main/resources/internal/META-INF/microprofile-config.properties
@@ -49,6 +49,14 @@ tck.config.test.javaconfig.converter.localdatevalue.broken = alfasdf
tck.config.test.javaconfig.converter.localdatetimevalue = 2017-12-24T10:25:30
tck.config.test.javaconfig.converter.localdatetimevalue.broken = alfasdf
+tck.config.test.javaconfig.converter.offsetdatetimevalue = 2007-12-03T10:15:30+01:00
+tck.config.test.javaconfig.converter.offsetdatetimevalue.broken = alfasdf
+
+tck.config.test.javaconfig.converter.offsettimevalue = 13:45.30.123456789+02:00
+tck.config.test.javaconfig.converter.offsettimevalue.broken = alfasdf
+
+tck.config.test.javaconfig.converter.instantvalue = 2015-06-02T21:34:33.616Z
+tck.config.test.javaconfig.converter.instantvalue.broken = alfasdf
tck.config.test.javaconfig.configvalue.key1=value1