Expand with actual use case test

This commit is contained in:
dotasek 2023-04-17 17:24:19 -04:00
parent 8ab4e8e73a
commit 4494a6f757
1 changed files with 19 additions and 1 deletions

View File

@ -15,7 +15,7 @@ public class SubscriptionTopic43_50Test {
@Test
@DisplayName("Test r5 -> r4 SubscriptionTopic conversion.")
public void testR5_R4() throws IOException {
public void testR5_R4b() throws IOException {
InputStream r5_input = this.getClass().getResourceAsStream("/subscription_topic_50.json");
org.hl7.fhir.r5.model.SubscriptionTopic r5_actual = (org.hl7.fhir.r5.model.SubscriptionTopic) new org.hl7.fhir.r5.formats.JsonParser().parse(r5_input);
@ -32,4 +32,22 @@ public class SubscriptionTopic43_50Test {
assertTrue(r5_actual.equalsDeep(r5_conv), "should be the same");
}
@Test
@DisplayName("Test r4b -> r5 SubscriptionTopic conversion.")
public void testR4b_R5() throws IOException {
InputStream r4b_input = this.getClass().getResourceAsStream("/subscription_topic_43.json");
org.hl7.fhir.r4b.model.SubscriptionTopic r4b_actual = (org.hl7.fhir.r4b.model.SubscriptionTopic) new org.hl7.fhir.r4b.formats.JsonParser().parse(r4b_input);
org.hl7.fhir.r5.model.Resource r5_conv = VersionConvertorFactory_43_50.convertResource(r4b_actual);
org.hl7.fhir.r5.formats.JsonParser r5_parser = new org.hl7.fhir.r5.formats.JsonParser();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
r5_parser.compose(stream, r5_conv);
org.hl7.fhir.r5.model.Resource r5_streamed = new org.hl7.fhir.r5.formats.JsonParser().parse(new ByteArrayInputStream(stream.toByteArray()));
org.hl7.fhir.r4b.model.Resource r4b_conv = VersionConvertorFactory_43_50.convertResource(r5_streamed);
assertTrue(r4b_actual.equalsDeep(r4b_conv), "should be the same");
}
}