From ad49c9aecd87207f04700da431d6a01078a184f0 Mon Sep 17 00:00:00 2001 From: dotasek Date: Wed, 16 Mar 2022 12:33:01 -0400 Subject: [PATCH] Rename params helper method --- .../VersionConvertorPrimitiveTypeTests.java | 90 ++++++++++--------- 1 file changed, 47 insertions(+), 43 deletions(-) diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/VersionConvertorPrimitiveTypeTests.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/VersionConvertorPrimitiveTypeTests.java index 5560e3659..53621af1b 100644 --- a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/VersionConvertorPrimitiveTypeTests.java +++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/VersionConvertorPrimitiveTypeTests.java @@ -19,6 +19,10 @@ public class VersionConvertorPrimitiveTypeTests { "dGhpcyBpcyB2YWxpZCBiYXNlNjQ=" }; + private static String[] BOOLEAN_STRINGS = { + "true", "false" + }; + private static String[] DEFAULT_DATE_PRECISION_STRINGS = { "1933", "1933-01", "1933-01-02" }; @@ -35,7 +39,7 @@ public class VersionConvertorPrimitiveTypeTests { "1933-01-02T13:45:12", "1933-01-02T13:45:12.3", "1933-01-02T13:45:12.3456" }; - private static Stream getDateTimeArgs(Class versionConverterFactoryClazz, Class firstTypeClazz, Class firstTypeMethodClazz, Class secondTypeClazz, Class secondTypeMethodClazz, String[] testStrings) { + private static Stream getConversionParams(Class versionConverterFactoryClazz, Class firstTypeClazz, Class firstTypeMethodClazz, Class secondTypeClazz, Class secondTypeMethodClazz, String[] testStrings) { return Arrays.stream(testStrings).map( it -> Arguments.of(versionConverterFactoryClazz, firstTypeClazz, firstTypeMethodClazz, it, @@ -46,179 +50,179 @@ public class VersionConvertorPrimitiveTypeTests { private static Stream getParams() { return Stream.of( //Base64Binary - getDateTimeArgs(VersionConvertorFactory_10_30.class, + getConversionParams(VersionConvertorFactory_10_30.class, org.hl7.fhir.dstu2.model.Base64BinaryType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.dstu3.model.Base64BinaryType.class, org.hl7.fhir.dstu3.model.Type.class, BASE64_BINARY_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_40.class, + getConversionParams(VersionConvertorFactory_10_40.class, org.hl7.fhir.dstu2.model.Base64BinaryType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.r4.model.Base64BinaryType.class, org.hl7.fhir.r4.model.Type.class, BASE64_BINARY_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_50.class, + getConversionParams(VersionConvertorFactory_10_50.class, org.hl7.fhir.dstu2.model.Base64BinaryType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.r5.model.Base64BinaryType.class, org.hl7.fhir.r5.model.DataType.class, BASE64_BINARY_STRINGS), - getDateTimeArgs(VersionConvertorFactory_14_30.class, + getConversionParams(VersionConvertorFactory_14_30.class, org.hl7.fhir.dstu2016may.model.Base64BinaryType.class, org.hl7.fhir.dstu2016may.model.Type.class, org.hl7.fhir.dstu3.model.Base64BinaryType.class, org.hl7.fhir.dstu3.model.Type.class, BASE64_BINARY_STRINGS), - getDateTimeArgs(VersionConvertorFactory_14_40.class, + getConversionParams(VersionConvertorFactory_14_40.class, org.hl7.fhir.dstu2016may.model.Base64BinaryType.class, org.hl7.fhir.dstu2016may.model.Type.class, org.hl7.fhir.r4.model.Base64BinaryType.class, org.hl7.fhir.r4.model.Type.class, BASE64_BINARY_STRINGS), - getDateTimeArgs(VersionConvertorFactory_14_50.class, + getConversionParams(VersionConvertorFactory_14_50.class, org.hl7.fhir.dstu2016may.model.Base64BinaryType.class, org.hl7.fhir.dstu2016may.model.Type.class, org.hl7.fhir.r5.model.Base64BinaryType.class, org.hl7.fhir.r5.model.DataType.class, BASE64_BINARY_STRINGS), - getDateTimeArgs(VersionConvertorFactory_30_40.class, + getConversionParams(VersionConvertorFactory_30_40.class, org.hl7.fhir.dstu3.model.Base64BinaryType.class, org.hl7.fhir.dstu3.model.Type.class, org.hl7.fhir.r4.model.Base64BinaryType.class, org.hl7.fhir.r4.model.Type.class, BASE64_BINARY_STRINGS), - getDateTimeArgs(VersionConvertorFactory_30_50.class, + getConversionParams(VersionConvertorFactory_30_50.class, org.hl7.fhir.dstu3.model.Base64BinaryType.class, org.hl7.fhir.dstu3.model.Type.class, org.hl7.fhir.r5.model.Base64BinaryType.class, org.hl7.fhir.r5.model.DataType.class, BASE64_BINARY_STRINGS), - getDateTimeArgs(VersionConvertorFactory_40_50.class, + getConversionParams(VersionConvertorFactory_40_50.class, org.hl7.fhir.r4.model.Base64BinaryType.class, org.hl7.fhir.r4.model.Type.class, org.hl7.fhir.r5.model.Base64BinaryType.class, org.hl7.fhir.r5.model.DataType.class, BASE64_BINARY_STRINGS), //Date - getDateTimeArgs(VersionConvertorFactory_10_30.class, + getConversionParams(VersionConvertorFactory_10_30.class, org.hl7.fhir.dstu2.model.DateType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.dstu3.model.DateType.class, org.hl7.fhir.dstu3.model.Type.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_40.class, + getConversionParams(VersionConvertorFactory_10_40.class, org.hl7.fhir.dstu2.model.DateType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.r4.model.DateType.class, org.hl7.fhir.r4.model.Type.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_50.class, + getConversionParams(VersionConvertorFactory_10_50.class, org.hl7.fhir.dstu2.model.DateType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.r5.model.DateType.class, org.hl7.fhir.r5.model.DataType.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_14_30.class, + getConversionParams(VersionConvertorFactory_14_30.class, org.hl7.fhir.dstu2016may.model.DateType.class, org.hl7.fhir.dstu2016may.model.Type.class, org.hl7.fhir.dstu3.model.DateType.class, org.hl7.fhir.dstu3.model.Type.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_14_40.class, + getConversionParams(VersionConvertorFactory_14_40.class, org.hl7.fhir.dstu2016may.model.DateType.class, org.hl7.fhir.dstu2016may.model.Type.class, org.hl7.fhir.r4.model.DateType.class, org.hl7.fhir.r4.model.Type.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_14_50.class, + getConversionParams(VersionConvertorFactory_14_50.class, org.hl7.fhir.dstu2016may.model.DateType.class, org.hl7.fhir.dstu2016may.model.Type.class, org.hl7.fhir.r5.model.DateType.class, org.hl7.fhir.r5.model.DataType.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_30_40.class, + getConversionParams(VersionConvertorFactory_30_40.class, org.hl7.fhir.dstu3.model.DateType.class, org.hl7.fhir.dstu3.model.Type.class, org.hl7.fhir.r4.model.DateType.class, org.hl7.fhir.r4.model.Type.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_30_50.class, + getConversionParams(VersionConvertorFactory_30_50.class, org.hl7.fhir.dstu3.model.DateType.class, org.hl7.fhir.dstu3.model.Type.class, org.hl7.fhir.r5.model.DateType.class, org.hl7.fhir.r5.model.DataType.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_40_50.class, + getConversionParams(VersionConvertorFactory_40_50.class, org.hl7.fhir.r4.model.DateType.class, org.hl7.fhir.r4.model.Type.class, org.hl7.fhir.r5.model.DateType.class, org.hl7.fhir.r5.model.DataType.class, DEFAULT_DATE_PRECISION_STRINGS), //Date DateTime - getDateTimeArgs(VersionConvertorFactory_10_30.class, + getConversionParams(VersionConvertorFactory_10_30.class, org.hl7.fhir.dstu2.model.DateType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.dstu3.model.DateTimeType.class, org.hl7.fhir.dstu3.model.Type.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_40.class, + getConversionParams(VersionConvertorFactory_10_40.class, org.hl7.fhir.dstu2.model.DateType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.r4.model.DateTimeType.class, org.hl7.fhir.r4.model.Type.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_50.class, + getConversionParams(VersionConvertorFactory_10_50.class, org.hl7.fhir.dstu2.model.DateType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.r5.model.DateTimeType.class, org.hl7.fhir.r5.model.DataType.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_30.class, + getConversionParams(VersionConvertorFactory_10_30.class, org.hl7.fhir.dstu2.model.DateTimeType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.dstu3.model.DateType.class, org.hl7.fhir.dstu3.model.Type.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_40.class, + getConversionParams(VersionConvertorFactory_10_40.class, org.hl7.fhir.dstu2.model.DateTimeType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.r4.model.DateType.class, org.hl7.fhir.r4.model.Type.class, DEFAULT_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_50.class, + getConversionParams(VersionConvertorFactory_10_50.class, org.hl7.fhir.dstu2.model.DateTimeType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.r5.model.DateType.class, org.hl7.fhir.r5.model.DataType.class, DEFAULT_DATE_PRECISION_STRINGS), //DateTime - getDateTimeArgs(VersionConvertorFactory_10_30.class, + getConversionParams(VersionConvertorFactory_10_30.class, org.hl7.fhir.dstu2.model.DateTimeType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.dstu3.model.DateTimeType.class, org.hl7.fhir.dstu3.model.Type.class, MILLISECOND_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_40.class, + getConversionParams(VersionConvertorFactory_10_40.class, org.hl7.fhir.dstu2.model.DateTimeType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.r4.model.DateTimeType.class, org.hl7.fhir.r4.model.Type.class, MILLISECOND_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_50.class, + getConversionParams(VersionConvertorFactory_10_50.class, org.hl7.fhir.dstu2.model.DateTimeType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.r5.model.DateTimeType.class, org.hl7.fhir.r5.model.DataType.class, MILLISECOND_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_14_30.class, + getConversionParams(VersionConvertorFactory_14_30.class, org.hl7.fhir.dstu2016may.model.DateTimeType.class, org.hl7.fhir.dstu2016may.model.Type.class, org.hl7.fhir.dstu3.model.DateTimeType.class, org.hl7.fhir.dstu3.model.Type.class, MILLISECOND_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_14_40.class, + getConversionParams(VersionConvertorFactory_14_40.class, org.hl7.fhir.dstu2016may.model.DateTimeType.class, org.hl7.fhir.dstu2016may.model.Type.class, org.hl7.fhir.r4.model.DateTimeType.class, org.hl7.fhir.r4.model.Type.class, MILLISECOND_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_14_50.class, + getConversionParams(VersionConvertorFactory_14_50.class, org.hl7.fhir.dstu2016may.model.DateTimeType.class, org.hl7.fhir.dstu2016may.model.Type.class, org.hl7.fhir.r5.model.DateTimeType.class, org.hl7.fhir.r5.model.DataType.class, MILLISECOND_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_30_40.class, + getConversionParams(VersionConvertorFactory_30_40.class, org.hl7.fhir.dstu3.model.DateTimeType.class, org.hl7.fhir.dstu3.model.Type.class, org.hl7.fhir.r4.model.DateTimeType.class, org.hl7.fhir.r4.model.Type.class, MILLISECOND_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_30_50.class, + getConversionParams(VersionConvertorFactory_30_50.class, org.hl7.fhir.dstu3.model.DateTimeType.class, org.hl7.fhir.dstu3.model.Type.class, org.hl7.fhir.r5.model.DateTimeType.class, org.hl7.fhir.r5.model.DataType.class, MILLISECOND_DATE_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_40_50.class, + getConversionParams(VersionConvertorFactory_40_50.class, org.hl7.fhir.r4.model.DateTimeType.class, org.hl7.fhir.r4.model.Type.class, org.hl7.fhir.r5.model.DateTimeType.class, org.hl7.fhir.r5.model.DataType.class, MILLISECOND_DATE_PRECISION_STRINGS), //Instant - getDateTimeArgs(VersionConvertorFactory_10_30.class, + getConversionParams(VersionConvertorFactory_10_30.class, org.hl7.fhir.dstu2.model.InstantType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.dstu3.model.InstantType.class, org.hl7.fhir.dstu3.model.Type.class, INSTANT_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_40.class, + getConversionParams(VersionConvertorFactory_10_40.class, org.hl7.fhir.dstu2.model.InstantType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.r4.model.InstantType.class, org.hl7.fhir.r4.model.Type.class, INSTANT_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_10_50.class, + getConversionParams(VersionConvertorFactory_10_50.class, org.hl7.fhir.dstu2.model.InstantType.class, org.hl7.fhir.dstu2.model.Type.class, org.hl7.fhir.r5.model.InstantType.class, org.hl7.fhir.r5.model.DataType.class, INSTANT_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_14_30.class, + getConversionParams(VersionConvertorFactory_14_30.class, org.hl7.fhir.dstu2016may.model.InstantType.class, org.hl7.fhir.dstu2016may.model.Type.class, org.hl7.fhir.dstu3.model.InstantType.class, org.hl7.fhir.dstu3.model.Type.class, INSTANT_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_14_40.class, + getConversionParams(VersionConvertorFactory_14_40.class, org.hl7.fhir.dstu2016may.model.InstantType.class, org.hl7.fhir.dstu2016may.model.Type.class, org.hl7.fhir.r4.model.InstantType.class, org.hl7.fhir.r4.model.Type.class, INSTANT_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_14_50.class, + getConversionParams(VersionConvertorFactory_14_50.class, org.hl7.fhir.dstu2016may.model.InstantType.class, org.hl7.fhir.dstu2016may.model.Type.class, org.hl7.fhir.r5.model.InstantType.class, org.hl7.fhir.r5.model.DataType.class, INSTANT_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_30_40.class, + getConversionParams(VersionConvertorFactory_30_40.class, org.hl7.fhir.dstu3.model.InstantType.class, org.hl7.fhir.dstu3.model.Type.class, org.hl7.fhir.r4.model.InstantType.class, org.hl7.fhir.r4.model.Type.class, INSTANT_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_30_50.class, + getConversionParams(VersionConvertorFactory_30_50.class, org.hl7.fhir.dstu3.model.InstantType.class, org.hl7.fhir.dstu3.model.Type.class, org.hl7.fhir.r5.model.InstantType.class, org.hl7.fhir.r5.model.DataType.class, INSTANT_PRECISION_STRINGS), - getDateTimeArgs(VersionConvertorFactory_40_50.class, + getConversionParams(VersionConvertorFactory_40_50.class, org.hl7.fhir.r4.model.InstantType.class, org.hl7.fhir.r4.model.Type.class, org.hl7.fhir.r5.model.InstantType.class, org.hl7.fhir.r5.model.DataType.class, INSTANT_PRECISION_STRINGS)