Adding proper null checks for convertor factories. (#579)

* wip

* wip

* sdjkhfakjsdhllkjsdhfsdkh
This commit is contained in:
Mark Iantorno 2021-08-18 21:43:39 -04:00 committed by GitHub
parent a02114e34d
commit 72e88cb12f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 1033 additions and 45 deletions

View File

@ -0,0 +1,25 @@
package org.hl7.fhir.convertors.factory;
import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.IBaseDatatype;
import org.hl7.fhir.instance.model.api.IBaseResource;
public abstract class VersionConvertorFactory {
public static void cleanInputs(IBaseResource res, BaseAdvisor advisor) {
checkDataAndAdvisor(res, advisor);
}
public static void cleanInputs(IBaseDatatype res, BaseAdvisor advisor) {
checkDataAndAdvisor(res, advisor);
}
private static void checkDataAndAdvisor(Object o, BaseAdvisor advisor) {
if (advisor == null) {
throw new FHIRException("Null conversion advisor passed to factory method.");
}
if (advisor.failFastOnNullOrUnknownEntry() && o == null) {
throw new FHIRException("ConversionFactory received null input. Conversion advisor set to failFastOnNullInput.");
}
}
}

View File

@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
public final class VersionConvertorFactory_10_30 {
public final class VersionConvertorFactory_10_30 extends VersionConvertorFactory {
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_10_30());
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src, BaseAdvisor_10_30 advisor) throws FHIRException {
return new VersionConvertor_10_30(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_10_30(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src) throws FHIRException {
@ -20,7 +21,8 @@ public final class VersionConvertorFactory_10_30 {
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src, BaseAdvisor_10_30 advisor) throws FHIRException {
return new VersionConvertor_10_30(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_10_30(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.dstu2.model.Type src) throws FHIRException {
@ -28,7 +30,8 @@ public final class VersionConvertorFactory_10_30 {
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.dstu2.model.Type src, BaseAdvisor_10_30 advisor) throws FHIRException {
return new VersionConvertor_10_30(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_10_30(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.dstu3.model.Type src) throws FHIRException {
@ -36,7 +39,8 @@ public final class VersionConvertorFactory_10_30 {
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.dstu3.model.Type src, BaseAdvisor_10_30 advisor) throws FHIRException {
return new VersionConvertor_10_30(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_10_30(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {

View File

@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv10_40.VersionConvertor_10_40;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
public final class VersionConvertorFactory_10_40 {
public final class VersionConvertorFactory_10_40 extends VersionConvertorFactory {
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_10_40());
}
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src, BaseAdvisor_10_40 advisor) throws FHIRException {
return new VersionConvertor_10_40(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_10_40(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src) throws FHIRException {
@ -20,7 +21,8 @@ public final class VersionConvertorFactory_10_40 {
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src, BaseAdvisor_10_40 advisor) throws FHIRException {
return new VersionConvertor_10_40(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_10_40(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu2.model.Type src) throws FHIRException {
@ -28,7 +30,8 @@ public final class VersionConvertorFactory_10_40 {
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu2.model.Type src, BaseAdvisor_10_40 advisor) throws FHIRException {
return new VersionConvertor_10_40(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_10_40(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.r4.model.Type src) throws FHIRException {
@ -36,7 +39,8 @@ public final class VersionConvertorFactory_10_40 {
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.r4.model.Type src, BaseAdvisor_10_40 advisor) throws FHIRException {
return new VersionConvertor_10_40(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_10_40(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {

View File

@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv10_50.VersionConvertor_10_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
public final class VersionConvertorFactory_10_50 {
public final class VersionConvertorFactory_10_50 extends VersionConvertorFactory {
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_10_50());
}
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src, BaseAdvisor_10_50 advisor) throws FHIRException {
return new VersionConvertor_10_50(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_10_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src) throws FHIRException {
@ -20,7 +21,8 @@ public final class VersionConvertorFactory_10_50 {
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src, BaseAdvisor_10_50 advisor) throws FHIRException {
return new VersionConvertor_10_50(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_10_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu2.model.Type src) throws FHIRException {
@ -28,7 +30,8 @@ public final class VersionConvertorFactory_10_50 {
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu2.model.Type src, BaseAdvisor_10_50 advisor) throws FHIRException {
return new VersionConvertor_10_50(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_10_50(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException {
@ -36,7 +39,8 @@ public final class VersionConvertorFactory_10_50 {
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.r5.model.DataType src, BaseAdvisor_10_50 advisor) throws FHIRException {
return new VersionConvertor_10_50(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_10_50(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {

View File

@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv14_30.VersionConvertor_14_30;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
public final class VersionConvertorFactory_14_30 {
public final class VersionConvertorFactory_14_30 extends VersionConvertorFactory {
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.dstu2016may.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_14_30());
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.dstu2016may.model.Resource src, BaseAdvisor_14_30 advisor) throws FHIRException {
return new VersionConvertor_14_30(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_14_30(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu2016may.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src) throws FHIRException {
@ -20,7 +21,8 @@ public final class VersionConvertorFactory_14_30 {
}
public static org.hl7.fhir.dstu2016may.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src, BaseAdvisor_14_30 advisor) throws FHIRException {
return new VersionConvertor_14_30(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_14_30(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.dstu2016may.model.Type src) throws FHIRException {
@ -28,7 +30,8 @@ public final class VersionConvertorFactory_14_30 {
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.dstu2016may.model.Type src, BaseAdvisor_14_30 advisor) throws FHIRException {
return new VersionConvertor_14_30(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_14_30(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu2016may.model.Type convertType(org.hl7.fhir.dstu3.model.Type src) throws FHIRException {
@ -36,7 +39,8 @@ public final class VersionConvertorFactory_14_30 {
}
public static org.hl7.fhir.dstu2016may.model.Type convertType(org.hl7.fhir.dstu3.model.Type src, BaseAdvisor_14_30 advisor) throws FHIRException {
return new VersionConvertor_14_30(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_14_30(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {

View File

@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv14_40.VersionConvertor_14_40;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
public final class VersionConvertorFactory_14_40 {
public final class VersionConvertorFactory_14_40 extends VersionConvertorFactory {
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.dstu2016may.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_14_40());
}
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.dstu2016may.model.Resource src, BaseAdvisor_14_40 advisor) throws FHIRException {
return new VersionConvertor_14_40(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_14_40(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu2016may.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src) throws FHIRException {
@ -20,7 +21,8 @@ public final class VersionConvertorFactory_14_40 {
}
public static org.hl7.fhir.dstu2016may.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src, BaseAdvisor_14_40 advisor) throws FHIRException {
return new VersionConvertor_14_40(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_14_40(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu2016may.model.Type src) throws FHIRException {
@ -28,7 +30,8 @@ public final class VersionConvertorFactory_14_40 {
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu2016may.model.Type src, BaseAdvisor_14_40 advisor) throws FHIRException {
return new VersionConvertor_14_40(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_14_40(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu2016may.model.Type convertType(org.hl7.fhir.r4.model.Type src) throws FHIRException {
@ -36,7 +39,8 @@ public final class VersionConvertorFactory_14_40 {
}
public static org.hl7.fhir.dstu2016may.model.Type convertType(org.hl7.fhir.r4.model.Type src, BaseAdvisor_14_40 advisor) throws FHIRException {
return new VersionConvertor_14_40(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_14_40(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {

View File

@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv14_50.VersionConvertor_14_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
public final class VersionConvertorFactory_14_50 {
public final class VersionConvertorFactory_14_50 extends VersionConvertorFactory {
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.dstu2016may.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_14_50());
}
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.dstu2016may.model.Resource src, BaseAdvisor_14_50 advisor) throws FHIRException {
return new VersionConvertor_14_50(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_14_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu2016may.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src) throws FHIRException {
@ -20,7 +21,8 @@ public final class VersionConvertorFactory_14_50 {
}
public static org.hl7.fhir.dstu2016may.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src, BaseAdvisor_14_50 advisor) throws FHIRException {
return new VersionConvertor_14_50(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_14_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu2016may.model.Type src) throws FHIRException {
@ -28,7 +30,8 @@ public final class VersionConvertorFactory_14_50 {
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu2016may.model.Type src, BaseAdvisor_14_50 advisor) throws FHIRException {
return new VersionConvertor_14_50(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_14_50(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu2016may.model.Type convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException {
@ -36,7 +39,8 @@ public final class VersionConvertorFactory_14_50 {
}
public static org.hl7.fhir.dstu2016may.model.Type convertType(org.hl7.fhir.r5.model.DataType src, BaseAdvisor_14_50 advisor) throws FHIRException {
return new VersionConvertor_14_50(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_14_50(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {

View File

@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv30_40.VersionConvertor_30_40;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
public final class VersionConvertorFactory_30_40 {
public final class VersionConvertorFactory_30_40 extends VersionConvertorFactory {
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_30_40());
}
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src, BaseAdvisor_30_40 advisor) throws FHIRException {
return new VersionConvertor_30_40(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_30_40(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src) throws FHIRException {
@ -20,7 +21,8 @@ public final class VersionConvertorFactory_30_40 {
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src, BaseAdvisor_30_40 advisor) throws FHIRException {
return new VersionConvertor_30_40(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_30_40(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu3.model.Type src) throws FHIRException {
@ -28,7 +30,8 @@ public final class VersionConvertorFactory_30_40 {
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu3.model.Type src, BaseAdvisor_30_40 advisor) throws FHIRException {
return new VersionConvertor_30_40(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_30_40(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.r4.model.Type src) throws FHIRException {
@ -36,7 +39,8 @@ public final class VersionConvertorFactory_30_40 {
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.r4.model.Type src, BaseAdvisor_30_40 advisor) throws FHIRException {
return new VersionConvertor_30_40(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_30_40(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {

View File

@ -4,14 +4,15 @@ import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_50;
import org.hl7.fhir.convertors.conv30_50.VersionConvertor_30_50;
import org.hl7.fhir.exceptions.FHIRException;
public final class VersionConvertorFactory_30_50 {
public final class VersionConvertorFactory_30_50 extends VersionConvertorFactory {
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_30_50());
}
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src, BaseAdvisor_30_50 advisor) throws FHIRException {
return new VersionConvertor_30_50(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_30_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src) throws FHIRException {
@ -19,7 +20,8 @@ public final class VersionConvertorFactory_30_50 {
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src, BaseAdvisor_30_50 advisor) throws FHIRException {
return new VersionConvertor_30_50(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_30_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu3.model.Type src) throws FHIRException {
@ -27,7 +29,8 @@ public final class VersionConvertorFactory_30_50 {
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu3.model.Type src, BaseAdvisor_30_50 advisor) throws FHIRException {
return new VersionConvertor_30_50(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_30_50(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException {
@ -35,6 +38,7 @@ public final class VersionConvertorFactory_30_50 {
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.r5.model.DataType src, BaseAdvisor_30_50 advisor) throws FHIRException {
return new VersionConvertor_30_50(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_30_50(advisor).convertType(src) : null;
}
}

View File

@ -4,14 +4,15 @@ import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50;
import org.hl7.fhir.convertors.conv40_50.VersionConvertor_40_50;
import org.hl7.fhir.exceptions.FHIRException;
public final class VersionConvertorFactory_40_50 {
public final class VersionConvertorFactory_40_50 extends VersionConvertorFactory {
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_40_50());
}
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src, BaseAdvisor_40_50 advisor) throws FHIRException {
return new VersionConvertor_40_50(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_40_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src) throws FHIRException {
@ -19,7 +20,8 @@ public final class VersionConvertorFactory_40_50 {
}
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src, BaseAdvisor_40_50 advisor) throws FHIRException {
return new VersionConvertor_40_50(advisor).convertResource(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_40_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.r4.model.Type src) throws FHIRException {
@ -27,7 +29,8 @@ public final class VersionConvertorFactory_40_50 {
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.r4.model.Type src, BaseAdvisor_40_50 advisor) throws FHIRException {
return new VersionConvertor_40_50(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_40_50(advisor).convertType(src) : null;
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException {
@ -35,6 +38,7 @@ public final class VersionConvertorFactory_40_50 {
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.r5.model.DataType src, BaseAdvisor_40_50 advisor) throws FHIRException {
return new VersionConvertor_40_50(advisor).convertType(src);
cleanInputs(src, advisor);
return src != null ? new VersionConvertor_40_50(advisor).convertType(src) : null;
}
}

View File

@ -0,0 +1,103 @@
package org.hl7.fhir.convertors.factory;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_30;
import org.hl7.fhir.exceptions.FHIRException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class VersionConvertorFactory_10_30NullHandlingTest {
@Test
@DisplayName("Check null DSTU2 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorDSTU2() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_30.convertResource((org.hl7.fhir.dstu2.model.Resource) null);
});
}
@Test
@DisplayName("Check null DSTU2 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastDSTU2() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_30.convertResource((org.hl7.fhir.dstu2.model.Resource) null, new BaseAdvisor_10_30(true));
});
}
@Test
@DisplayName("Check null DSTU2 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastDSTU2() {
Assertions.assertNull(VersionConvertorFactory_10_30.convertResource((org.hl7.fhir.dstu2.model.Resource) null,
new BaseAdvisor_10_30(false)));
}
@Test
@DisplayName("Check null DSTU3 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_30.convertResource((org.hl7.fhir.dstu3.model.Resource) null);
});
}
@Test
@DisplayName("Check null DSTU3 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_30.convertResource((org.hl7.fhir.dstu3.model.Resource) null, new BaseAdvisor_10_30(true));
});
}
@Test
@DisplayName("Check null DSTU3 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastDSTU3() {
Assertions.assertNull(VersionConvertorFactory_10_30.convertResource((org.hl7.fhir.dstu3.model.Resource) null,
new BaseAdvisor_10_30(false)));
}
@Test
@DisplayName("Check null DSTU2 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorDSTU2() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_30.convertType((org.hl7.fhir.dstu2.model.Type) null);
});
}
@Test
@DisplayName("Check null DSTU2 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastDSTU2() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_30.convertType((org.hl7.fhir.dstu2.model.Type) null, new BaseAdvisor_10_30(true));
});
}
@Test
@DisplayName("Check null DSTU2 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastDSTU2() {
Assertions.assertNull(VersionConvertorFactory_10_30.convertType((org.hl7.fhir.dstu2.model.Type) null,
new BaseAdvisor_10_30(false)));
}
@Test
@DisplayName("Check null DSTU3 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_30.convertType((org.hl7.fhir.dstu3.model.Type) null);
});
}
@Test
@DisplayName("Check null DSTU3 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_30.convertType((org.hl7.fhir.dstu3.model.Type) null, new BaseAdvisor_10_30(true));
});
}
@Test
@DisplayName("Check null DSTU3 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastDSTU3() {
Assertions.assertNull(VersionConvertorFactory_10_30.convertType((org.hl7.fhir.dstu3.model.Type) null,
new BaseAdvisor_10_30(false)));
}
}

View File

@ -0,0 +1,103 @@
package org.hl7.fhir.convertors.factory;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_40;
import org.hl7.fhir.exceptions.FHIRException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class VersionConvertorFactory_10_40NullHandlingTest {
@Test
@DisplayName("Check null DSTU2 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorDSTU2() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_40.convertResource((org.hl7.fhir.dstu2.model.Resource) null);
});
}
@Test
@DisplayName("Check null DSTU2 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastDSTU2() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_40.convertResource((org.hl7.fhir.dstu2.model.Resource) null, new BaseAdvisor_10_40(true));
});
}
@Test
@DisplayName("Check null DSTU2 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastDSTU2() {
Assertions.assertNull(VersionConvertorFactory_10_40.convertResource((org.hl7.fhir.dstu2.model.Resource) null,
new BaseAdvisor_10_40(false)));
}
@Test
@DisplayName("Check null R4 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_40.convertResource((org.hl7.fhir.r4.model.Resource) null);
});
}
@Test
@DisplayName("Check null R4 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_40.convertResource((org.hl7.fhir.r4.model.Resource) null, new BaseAdvisor_10_40(true));
});
}
@Test
@DisplayName("Check null R4 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastR4() {
Assertions.assertNull(VersionConvertorFactory_10_40.convertResource((org.hl7.fhir.r4.model.Resource) null,
new BaseAdvisor_10_40(false)));
}
@Test
@DisplayName("Check null DSTU2 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorDSTU2() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_40.convertType((org.hl7.fhir.dstu2.model.Type) null);
});
}
@Test
@DisplayName("Check null DSTU2 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastDSTU2() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_40.convertType((org.hl7.fhir.dstu2.model.Type) null, new BaseAdvisor_10_40(true));
});
}
@Test
@DisplayName("Check null DSTU2 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastDSTU2() {
Assertions.assertNull(VersionConvertorFactory_10_40.convertType((org.hl7.fhir.dstu2.model.Type) null,
new BaseAdvisor_10_40(false)));
}
@Test
@DisplayName("Check null R4 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_40.convertType((org.hl7.fhir.r4.model.Type) null);
});
}
@Test
@DisplayName("Check null R4 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_40.convertType((org.hl7.fhir.r4.model.Type) null, new BaseAdvisor_10_40(true));
});
}
@Test
@DisplayName("Check null R4 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastR4() {
Assertions.assertNull(VersionConvertorFactory_10_40.convertType((org.hl7.fhir.r4.model.Type) null,
new BaseAdvisor_10_40(false)));
}
}

View File

@ -0,0 +1,103 @@
package org.hl7.fhir.convertors.factory;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class VersionConvertorFactory_10_50NullHandlingTest {
@Test
@DisplayName("Check null DSTU2 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorDSTU2() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.dstu2.model.Resource) null);
});
}
@Test
@DisplayName("Check null DSTU2 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastDSTU2() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.dstu2.model.Resource) null, new BaseAdvisor_10_50(true));
});
}
@Test
@DisplayName("Check null DSTU2 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastDSTU2() {
Assertions.assertNull(VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.dstu2.model.Resource) null,
new BaseAdvisor_10_50(false)));
}
@Test
@DisplayName("Check null R5 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.r5.model.Resource) null);
});
}
@Test
@DisplayName("Check null R5 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.r5.model.Resource) null, new BaseAdvisor_10_50(true));
});
}
@Test
@DisplayName("Check null R5 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastR5() {
Assertions.assertNull(VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.r5.model.Resource) null,
new BaseAdvisor_10_50(false)));
}
@Test
@DisplayName("Check null DSTU2 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorDSTU2() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_50.convertType((org.hl7.fhir.dstu2.model.Type) null);
});
}
@Test
@DisplayName("Check null DSTU2 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastDSTU2() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_50.convertType((org.hl7.fhir.dstu2.model.Type) null, new BaseAdvisor_10_50(true));
});
}
@Test
@DisplayName("Check null DSTU2 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastDSTU2() {
Assertions.assertNull(VersionConvertorFactory_10_50.convertType((org.hl7.fhir.dstu2.model.Type) null,
new BaseAdvisor_10_50(false)));
}
@Test
@DisplayName("Check null R5 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_50.convertType((org.hl7.fhir.r5.model.DataType) null);
});
}
@Test
@DisplayName("Check null R5 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_10_50.convertType((org.hl7.fhir.r5.model.DataType) null, new BaseAdvisor_10_50(true));
});
}
@Test
@DisplayName("Check null R5 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastR5() {
Assertions.assertNull(VersionConvertorFactory_10_50.convertType((org.hl7.fhir.r5.model.DataType) null,
new BaseAdvisor_10_50(false)));
}
}

View File

@ -0,0 +1,103 @@
package org.hl7.fhir.convertors.factory;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_14_30;
import org.hl7.fhir.exceptions.FHIRException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class VersionConvertorFactory_14_30NullHandlingTest {
@Test
@DisplayName("Check null DSTU2016MAY resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorDSTU2016MAY() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_30.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null);
});
}
@Test
@DisplayName("Check null DSTU2016MAY resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastDSTU2016MAY() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_30.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null, new BaseAdvisor_14_30(true));
});
}
@Test
@DisplayName("Check null DSTU2016MAY resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastDSTU2016MAY() {
Assertions.assertNull(VersionConvertorFactory_14_30.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null,
new BaseAdvisor_14_30(false)));
}
@Test
@DisplayName("Check null DSTU3 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_30.convertResource((org.hl7.fhir.dstu3.model.Resource) null);
});
}
@Test
@DisplayName("Check null DSTU3 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_30.convertResource((org.hl7.fhir.dstu3.model.Resource) null, new BaseAdvisor_14_30(true));
});
}
@Test
@DisplayName("Check null DSTU3 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastDSTU3() {
Assertions.assertNull(VersionConvertorFactory_14_30.convertResource((org.hl7.fhir.dstu3.model.Resource) null,
new BaseAdvisor_14_30(false)));
}
@Test
@DisplayName("Check null DSTU2016MAY type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorDSTU2016MAY() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_30.convertType((org.hl7.fhir.dstu2016may.model.Type) null);
});
}
@Test
@DisplayName("Check null DSTU2016MAY type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastDSTU2016MAY() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_30.convertType((org.hl7.fhir.dstu2016may.model.Type) null, new BaseAdvisor_14_30(true));
});
}
@Test
@DisplayName("Check null DSTU2016MAY type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastDSTU2016MAY() {
Assertions.assertNull(VersionConvertorFactory_14_30.convertType((org.hl7.fhir.dstu2016may.model.Type) null,
new BaseAdvisor_14_30(false)));
}
@Test
@DisplayName("Check null DSTU3 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_30.convertType((org.hl7.fhir.dstu3.model.Type) null);
});
}
@Test
@DisplayName("Check null DSTU3 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_30.convertType((org.hl7.fhir.dstu3.model.Type) null, new BaseAdvisor_14_30(true));
});
}
@Test
@DisplayName("Check null DSTU3 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastDSTU3() {
Assertions.assertNull(VersionConvertorFactory_14_30.convertType((org.hl7.fhir.dstu3.model.Type) null,
new BaseAdvisor_14_30(false)));
}
}

View File

@ -0,0 +1,103 @@
package org.hl7.fhir.convertors.factory;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_14_40;
import org.hl7.fhir.exceptions.FHIRException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class VersionConvertorFactory_14_40NullHandlingTest {
@Test
@DisplayName("Check null DSTU2016MAY resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorDSTU2016MAY() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_40.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null);
});
}
@Test
@DisplayName("Check null DSTU2016MAY resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastDSTU2016MAY() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_40.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null, new BaseAdvisor_14_40(true));
});
}
@Test
@DisplayName("Check null DSTU2016MAY resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastDSTU2016MAY() {
Assertions.assertNull(VersionConvertorFactory_14_40.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null,
new BaseAdvisor_14_40(false)));
}
@Test
@DisplayName("Check null R4 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_40.convertResource((org.hl7.fhir.r4.model.Resource) null);
});
}
@Test
@DisplayName("Check null R4 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_40.convertResource((org.hl7.fhir.r4.model.Resource) null, new BaseAdvisor_14_40(true));
});
}
@Test
@DisplayName("Check null R4 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastR4() {
Assertions.assertNull(VersionConvertorFactory_14_40.convertResource((org.hl7.fhir.r4.model.Resource) null,
new BaseAdvisor_14_40(false)));
}
@Test
@DisplayName("Check null DSTU2016MAY type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorDSTU2016MAY() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_40.convertType((org.hl7.fhir.dstu2016may.model.Type) null);
});
}
@Test
@DisplayName("Check null DSTU2016MAY type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastDSTU2016MAY() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_40.convertType((org.hl7.fhir.dstu2016may.model.Type) null, new BaseAdvisor_14_40(true));
});
}
@Test
@DisplayName("Check null DSTU2016MAY type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastDSTU2016MAY() {
Assertions.assertNull(VersionConvertorFactory_14_40.convertType((org.hl7.fhir.dstu2016may.model.Type) null,
new BaseAdvisor_14_40(false)));
}
@Test
@DisplayName("Check null R4 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_40.convertType((org.hl7.fhir.r4.model.Type) null);
});
}
@Test
@DisplayName("Check null R4 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_40.convertType((org.hl7.fhir.r4.model.Type) null, new BaseAdvisor_14_40(true));
});
}
@Test
@DisplayName("Check null R4 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastR4() {
Assertions.assertNull(VersionConvertorFactory_14_40.convertType((org.hl7.fhir.r4.model.Type) null,
new BaseAdvisor_14_40(false)));
}
}

View File

@ -0,0 +1,103 @@
package org.hl7.fhir.convertors.factory;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_14_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class VersionConvertorFactory_14_50NullHandlingTest {
@Test
@DisplayName("Check null DSTU2016MAY resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorDSTU2016MAY() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_50.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null);
});
}
@Test
@DisplayName("Check null DSTU2016MAY resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastDSTU2016MAY() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_50.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null, new BaseAdvisor_14_50(true));
});
}
@Test
@DisplayName("Check null DSTU2016MAY resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastDSTU2016MAY() {
Assertions.assertNull(VersionConvertorFactory_14_50.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null,
new BaseAdvisor_14_50(false)));
}
@Test
@DisplayName("Check null R5 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_50.convertResource((org.hl7.fhir.r5.model.Resource) null);
});
}
@Test
@DisplayName("Check null R5 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_50.convertResource((org.hl7.fhir.r5.model.Resource) null, new BaseAdvisor_14_50(true));
});
}
@Test
@DisplayName("Check null R5 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastR5() {
Assertions.assertNull(VersionConvertorFactory_14_50.convertResource((org.hl7.fhir.r5.model.Resource) null,
new BaseAdvisor_14_50(false)));
}
@Test
@DisplayName("Check null DSTU2016MAY type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorDSTU2016MAY() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_50.convertType((org.hl7.fhir.dstu2016may.model.Type) null);
});
}
@Test
@DisplayName("Check null DSTU2016MAY type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastDSTU2016MAY() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_50.convertType((org.hl7.fhir.dstu2016may.model.Type) null, new BaseAdvisor_14_50(true));
});
}
@Test
@DisplayName("Check null DSTU2016MAY type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastDSTU2016MAY() {
Assertions.assertNull(VersionConvertorFactory_14_50.convertType((org.hl7.fhir.dstu2016may.model.Type) null,
new BaseAdvisor_14_50(false)));
}
@Test
@DisplayName("Check null R5 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_50.convertType((org.hl7.fhir.r5.model.DataType) null);
});
}
@Test
@DisplayName("Check null R5 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_14_50.convertType((org.hl7.fhir.r5.model.DataType) null, new BaseAdvisor_14_50(true));
});
}
@Test
@DisplayName("Check null R5 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastR5() {
Assertions.assertNull(VersionConvertorFactory_14_50.convertType((org.hl7.fhir.r5.model.DataType) null,
new BaseAdvisor_14_50(false)));
}
}

View File

@ -0,0 +1,103 @@
package org.hl7.fhir.convertors.factory;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_40;
import org.hl7.fhir.exceptions.FHIRException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class VersionConvertorFactory_30_40NullHandlingTest {
@Test
@DisplayName("Check null DSTU3 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_40.convertResource((org.hl7.fhir.dstu3.model.Resource) null);
});
}
@Test
@DisplayName("Check null DSTU3 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_40.convertResource((org.hl7.fhir.dstu3.model.Resource) null, new BaseAdvisor_30_40(true));
});
}
@Test
@DisplayName("Check null DSTU3 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastDSTU3() {
Assertions.assertNull(VersionConvertorFactory_30_40.convertResource((org.hl7.fhir.dstu3.model.Resource) null,
new BaseAdvisor_30_40(false)));
}
@Test
@DisplayName("Check null R4 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_40.convertResource((org.hl7.fhir.r4.model.Resource) null);
});
}
@Test
@DisplayName("Check null R4 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_40.convertResource((org.hl7.fhir.r4.model.Resource) null, new BaseAdvisor_30_40(true));
});
}
@Test
@DisplayName("Check null R4 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastR4() {
Assertions.assertNull(VersionConvertorFactory_30_40.convertResource((org.hl7.fhir.r4.model.Resource) null,
new BaseAdvisor_30_40(false)));
}
@Test
@DisplayName("Check null DSTU3 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_40.convertType((org.hl7.fhir.dstu3.model.Type) null);
});
}
@Test
@DisplayName("Check null DSTU3 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_40.convertType((org.hl7.fhir.dstu3.model.Type) null, new BaseAdvisor_30_40(true));
});
}
@Test
@DisplayName("Check null DSTU3 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastDSTU3() {
Assertions.assertNull(VersionConvertorFactory_30_40.convertType((org.hl7.fhir.dstu3.model.Type) null,
new BaseAdvisor_30_40(false)));
}
@Test
@DisplayName("Check null R4 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_40.convertType((org.hl7.fhir.r4.model.Type) null);
});
}
@Test
@DisplayName("Check null R4 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_40.convertType((org.hl7.fhir.r4.model.Type) null, new BaseAdvisor_30_40(true));
});
}
@Test
@DisplayName("Check null R4 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastR4() {
Assertions.assertNull(VersionConvertorFactory_30_40.convertType((org.hl7.fhir.r4.model.Type) null,
new BaseAdvisor_30_40(false)));
}
}

View File

@ -0,0 +1,103 @@
package org.hl7.fhir.convertors.factory;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class VersionConvertorFactory_30_50NullHandlingTest {
@Test
@DisplayName("Check null DSTU3 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.dstu3.model.Resource) null);
});
}
@Test
@DisplayName("Check null DSTU3 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.dstu3.model.Resource) null, new BaseAdvisor_30_50(true));
});
}
@Test
@DisplayName("Check null DSTU3 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastDSTU3() {
Assertions.assertNull(VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.dstu3.model.Resource) null,
new BaseAdvisor_30_50(false)));
}
@Test
@DisplayName("Check null R5 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.r5.model.Resource) null);
});
}
@Test
@DisplayName("Check null R5 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.r5.model.Resource) null, new BaseAdvisor_30_50(true));
});
}
@Test
@DisplayName("Check null R5 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastR5() {
Assertions.assertNull(VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.r5.model.Resource) null,
new BaseAdvisor_30_50(false)));
}
@Test
@DisplayName("Check null DSTU3 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_50.convertType((org.hl7.fhir.dstu3.model.Type) null);
});
}
@Test
@DisplayName("Check null DSTU3 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastDSTU3() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_50.convertType((org.hl7.fhir.dstu3.model.Type) null, new BaseAdvisor_30_50(true));
});
}
@Test
@DisplayName("Check null DSTU3 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastDSTU3() {
Assertions.assertNull(VersionConvertorFactory_30_50.convertType((org.hl7.fhir.dstu3.model.Type) null,
new BaseAdvisor_30_50(false)));
}
@Test
@DisplayName("Check null R5 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_50.convertType((org.hl7.fhir.r5.model.DataType) null);
});
}
@Test
@DisplayName("Check null R5 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_30_50.convertType((org.hl7.fhir.r5.model.DataType) null, new BaseAdvisor_30_50(true));
});
}
@Test
@DisplayName("Check null R5 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastR5() {
Assertions.assertNull(VersionConvertorFactory_30_50.convertType((org.hl7.fhir.r5.model.DataType) null,
new BaseAdvisor_30_50(false)));
}
}

View File

@ -0,0 +1,103 @@
package org.hl7.fhir.convertors.factory;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class VersionConvertorFactory_40_50NullHandlingTest {
@Test
@DisplayName("Check null R4 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r4.model.Resource) null);
});
}
@Test
@DisplayName("Check null R4 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r4.model.Resource) null, new BaseAdvisor_40_50(true));
});
}
@Test
@DisplayName("Check null R4 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastR4() {
Assertions.assertNull(VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r4.model.Resource) null,
new BaseAdvisor_40_50(false)));
}
@Test
@DisplayName("Check null R5 resource with default advisor throws FHIRException.")
void convertResourceWithDefaultAdvisorR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r5.model.Resource) null);
});
}
@Test
@DisplayName("Check null R5 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertResourceWithCustomAdvisorSetToFailFastR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r5.model.Resource) null, new BaseAdvisor_40_50(true));
});
}
@Test
@DisplayName("Check null R5 resource with custom advisor returns null when advisor set to not fail fast.")
void convertResourceWithCustomAdvisorSetToNotFailFastR5() {
Assertions.assertNull(VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r5.model.Resource) null,
new BaseAdvisor_40_50(false)));
}
@Test
@DisplayName("Check null R4 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_40_50.convertType((org.hl7.fhir.r4.model.Type) null);
});
}
@Test
@DisplayName("Check null R4 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastR4() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_40_50.convertType((org.hl7.fhir.r4.model.Type) null, new BaseAdvisor_40_50(true));
});
}
@Test
@DisplayName("Check null R4 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastR4() {
Assertions.assertNull(VersionConvertorFactory_40_50.convertType((org.hl7.fhir.r4.model.Type) null,
new BaseAdvisor_40_50(false)));
}
@Test
@DisplayName("Check null R5 type with default advisor throws FHIRException.")
void convertTypeWithDefaultAdvisorR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_40_50.convertType((org.hl7.fhir.r5.model.DataType) null);
});
}
@Test
@DisplayName("Check null R5 type with custom advisor throws FHIRException when advisor is set to fail fast.")
void convertTypeWithCustomAdvisorSetToFailFastR5() {
Assertions.assertThrows(FHIRException.class, () -> {
VersionConvertorFactory_40_50.convertType((org.hl7.fhir.r5.model.DataType) null, new BaseAdvisor_40_50(true));
});
}
@Test
@DisplayName("Check null R5 type with custom advisor returns null when advisor set to not fail fast.")
void convertTypeWithCustomAdvisorSetToNotFailFastR5() {
Assertions.assertNull(VersionConvertorFactory_40_50.convertType((org.hl7.fhir.r5.model.DataType) null,
new BaseAdvisor_40_50(false)));
}
}