diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/model/primitive/BaseDateTimeDtDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/model/primitive/BaseDateTimeDtDstu2Test.java index 3a7f51dd375..6e735919bea 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/model/primitive/BaseDateTimeDtDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/model/primitive/BaseDateTimeDtDstu2Test.java @@ -262,11 +262,13 @@ public class BaseDateTimeDtDstu2Test { verifyFails("1974-A2-25"); verifyFails("1974-12-A5"); + // Date shouldn't have a time zone verifyFails("1974-12-25Z"); verifyFails("1974-12-25+10:00"); // Out of range + verifyFails("2015-02-30"); verifyFails("1974-13-25"); verifyFails("1974-12-32"); verifyFails("2015-02-29"); diff --git a/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/model/BaseDateTimeTypeDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/model/BaseDateTimeTypeDstu3Test.java index b33bafbe6fd..820951f855e 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/model/BaseDateTimeTypeDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/org/hl7/fhir/dstu3/model/BaseDateTimeTypeDstu3Test.java @@ -145,6 +145,7 @@ public class BaseDateTimeTypeDstu3Test { verifyFails("1974-12-25+10:00"); // Out of range + verifyFails("2015-02-30"); verifyFails("1974-13-25"); verifyFails("1974-12-32"); verifyFails("2015-02-29");