use of com.b2international.snowowl.fhir.core.model.Extension in project snow-owl by b2ihealthcare.
the class ExtensionTest method buildWithStringSubextension.
@Test
public void buildWithStringSubextension() throws Exception {
Extension extension = StringExtension.builder().url("topURL").addExtension(StringExtension.builder().url("subURL").value("stringValue").build()).build();
printPrettyJson(extension);
assertEquals(new Uri("topURL"), extension.getUrl());
assertEquals(ExtensionType.STRING, extension.getExtensionType());
Extension subExtension = extension.getExtensions().iterator().next();
assertEquals(new Uri("subURL"), subExtension.getUrl());
assertEquals("stringValue", subExtension.getValue());
}
use of com.b2international.snowowl.fhir.core.model.Extension in project snow-owl by b2ihealthcare.
the class ExtensionTest method buildWithSubextension.
@Test
public void buildWithSubextension() throws Exception {
Extension<Integer> extension = IntegerExtension.builder().url("ID").addExtension(IntegerExtension.builder().url("ID2").value(2).build()).build();
printPrettyJson(extension);
assertEquals(new Uri("ID"), extension.getUrl());
assertEquals(ExtensionType.INTEGER, extension.getExtensionType());
Extension subExtension = extension.getExtensions().iterator().next();
assertEquals(new Uri("ID2"), subExtension.getUrl());
assertEquals(Integer.valueOf(2), subExtension.getValue());
}
Aggregations