More work on porting tests

This commit is contained in:
James 2017-08-01 20:43:47 -04:00
parent 43c9003258
commit e7f8f8c30d
31 changed files with 383 additions and 616 deletions

View File

@ -1,26 +1,7 @@
package ca.uhn.fhir.rest.client.api;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2017 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import org.hl7.fhir.instance.model.api.IBaseConformance;
import ca.uhn.fhir.model.base.resource.BaseConformance;
import ca.uhn.fhir.rest.annotation.Metadata;
/**
@ -36,6 +17,6 @@ public interface IBasicClient extends IRestfulClient {
* for more information.
*/
@Metadata
BaseConformance getServerConformanceStatement();
IBaseConformance getServerConformanceStatement();
}

View File

@ -187,7 +187,7 @@ public class ParameterUtil {
for (Annotation[] annotations : theMethod.getParameterAnnotations()) {
for (int annotationIndex = 0; annotationIndex < annotations.length; annotationIndex++) {
Annotation nextAnnotation = annotations[annotationIndex];
Class<? extends Annotation> class1 = nextAnnotation.getClass();
Class<? extends Annotation> class1 = nextAnnotation.annotationType();
if (toFind.isAssignableFrom(class1)) {
return paramIndex;
}

View File

@ -104,6 +104,11 @@ public abstract class BaseResourceReturningMethodBinding extends BaseMethodBindi
@Override
public Object invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map<String, List<String>> theHeaders) {
if (Constants.STATUS_HTTP_204_NO_CONTENT == theResponseStatusCode) {
return toReturnType(null);
}
IParser parser = createAppropriateParserForParsingResponse(theResponseMimeType, theResponseReader, theResponseStatusCode, myPreferTypesList);
switch (getReturnType()) {
@ -153,31 +158,44 @@ public abstract class BaseResourceReturningMethodBinding extends BaseMethodBindi
MethodUtil.parseClientRequestResourceHeaders(null, theHeaders, resource);
switch (getMethodReturnType()) {
case LIST_OF_RESOURCES:
return Collections.singletonList(resource);
case RESOURCE:
return resource;
case BUNDLE_RESOURCE:
return resource;
case METHOD_OUTCOME:
MethodOutcome retVal = new MethodOutcome();
retVal.setOperationOutcome((IBaseOperationOutcome) resource);
return retVal;
}
break;
return toReturnType(resource);
}
}
throw new IllegalStateException("Should not get here!");
}
private Object toReturnType(IBaseResource resource) {
Object retVal = null;
switch (getMethodReturnType()) {
case LIST_OF_RESOURCES:
retVal = Collections.emptyList();
if (resource != null) {
retVal = Collections.singletonList(resource);
}
break;
case RESOURCE:
retVal = resource;
break;
case BUNDLE_RESOURCE:
retVal = resource;
break;
case METHOD_OUTCOME:
MethodOutcome outcome = new MethodOutcome();
outcome.setOperationOutcome((IBaseOperationOutcome) resource);
retVal = outcome;
break;
}
return retVal;
}
@SuppressWarnings("unchecked")
private List<Class<? extends IBaseResource>> createPreferTypesList() {
List<Class<? extends IBaseResource>> preferTypes = null;
if (myResourceType != null && !BaseMethodBinding.isResourceInterface(myResourceType)) {
preferTypes = new ArrayList<Class<? extends IBaseResource>>(1);
preferTypes.add((Class<? extends IBaseResource>) myResourceType);
preferTypes.add(myResourceType);
} else if (myResourceListCollectionType != null && IBaseResource.class.isAssignableFrom(myResourceListCollectionType) && !BaseMethodBinding.isResourceInterface(myResourceListCollectionType)) {
preferTypes = new ArrayList<Class<? extends IBaseResource>>(1);
preferTypes.add((Class<? extends IBaseResource>) myResourceListCollectionType);

View File

@ -23,24 +23,19 @@ import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import java.lang.reflect.Method;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.Map.Entry;
import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
import ca.uhn.fhir.rest.annotation.Search;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
import ca.uhn.fhir.rest.api.SearchStyleEnum;
import ca.uhn.fhir.rest.api.*;
import ca.uhn.fhir.rest.client.impl.BaseHttpClientInvocation;
import ca.uhn.fhir.rest.param.ParameterUtil;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
@ -135,7 +130,7 @@ public class SearchMethodBinding extends BaseResourceReturningMethodBinding {
queryStringArgs.put(Constants.PARAM_QUERY, Collections.singletonList(myQueryName));
}
IdDt id = (IdDt) (myIdParamIndex != null ? theArgs[myIdParamIndex] : null);
IIdType id = (IIdType) (myIdParamIndex != null ? theArgs[myIdParamIndex] : null);
String resourceName = getResourceName();
if (theArgs != null) {
@ -167,7 +162,7 @@ public class SearchMethodBinding extends BaseResourceReturningMethodBinding {
}
public static BaseHttpClientInvocation createSearchInvocation(FhirContext theContext, String theResourceName, Map<String, List<String>> theParameters, IdDt theId, String theCompartmentName,
public static BaseHttpClientInvocation createSearchInvocation(FhirContext theContext, String theResourceName, Map<String, List<String>> theParameters, IIdType theId, String theCompartmentName,
SearchStyleEnum theSearchStyle) {
SearchStyleEnum searchStyle = theSearchStyle;
if (searchStyle == null) {

View File

@ -45,7 +45,7 @@ public class TransactionParameter implements IParameter {
if (theInnerCollectionType.equals(List.class) == false) {
throw new ConfigurationException(createParameterTypeError(theMethod));
}
if (theParameterType.equals(IResource.class) == false) {
if (theParameterType.equals(IResource.class) == false && theParameterType.equals(IBaseResource.class) == false) {
throw new ConfigurationException(createParameterTypeError(theMethod));
}
myParamStyle = ParamStyle.RESOURCE_LIST;

View File

@ -40,7 +40,7 @@ public class ValidateMethodBindingDstu2Plus extends OperationMethodBinding {
public ValidateMethodBindingDstu2Plus(Class<?> theReturnResourceType, Class<? extends IBaseResource> theReturnTypeFromRp, Method theMethod, FhirContext theContext, Object theProvider,
Validate theAnnotation) {
super(theReturnResourceType, theReturnTypeFromRp, theMethod, theContext, theProvider, true, Constants.EXTOP_VALIDATE, theAnnotation.type(), new OperationParam[0], BundleTypeEnum.COLLECTION);
super(null, theReturnTypeFromRp, theMethod, theContext, theProvider, true, Constants.EXTOP_VALIDATE, theAnnotation.type(), new OperationParam[0], BundleTypeEnum.COLLECTION);
List<IParameter> newParams = new ArrayList<IParameter>();
int idx = 0;

View File

@ -196,8 +196,8 @@
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -80,8 +80,8 @@
<!-- Testing -->
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -1,120 +0,0 @@
package ca.uhn.fhir.parser;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLEventWriter;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.events.XMLEvent;
import org.custommonkey.xmlunit.DetailedDiff;
import org.custommonkey.xmlunit.Diff;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.AfterClass;
import org.junit.Test;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.util.TestUtil;
import ca.uhn.fhir.util.XmlUtil;
public class RoundTripDstu2_1Test {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(RoundTripDstu2_1Test.class);
private static FhirContext ourCtx = FhirContext.forDstu2_1();
@Test
public void testIt() {
// Just so this doesn't complain until we enable roundtrip test
}
@AfterClass
public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest();
}
// @Test
public void testRoundTrip() throws Exception {
ZipInputStream is = new ZipInputStream(new FileInputStream("src/test/resources/examples.zip"));
try {
while (true) {
ZipEntry nextEntry = is.getNextEntry();
if (nextEntry == null) {
break;
}
ByteArrayOutputStream oos = new ByteArrayOutputStream();
byte[] buffer = new byte[2048];
int len = 0;
while ((len = is.read(buffer)) > 0) {
oos.write(buffer, 0, len);
}
String exampleText = oos.toString("UTF-8");
ourLog.info("Next file: {} - Size: {} bytes", nextEntry.getName(), exampleText.length());
if (!nextEntry.getName().contains("diagnosticreport-examples-lab")) {
continue;
}
IBaseResource parsed = ourCtx.newXmlParser().parseResource(exampleText);
String encodedXml = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
exampleText = cleanXml(exampleText);
encodedXml = cleanXml(encodedXml);
DetailedDiff d = new DetailedDiff(new Diff(new StringReader(exampleText), new StringReader(encodedXml)));
// d.overrideDifferenceListener(new DifferenceListener() {
//
// @Override
// public void skippedComparison(Node theControl, Node theTest) {
// ourLog.info("" + theControl);
// }
//
// @Override
// public int differenceFound(Difference theDifference) {
// ourLog.info("" + theDifference);
// return 0;
// }
// });
boolean similar = d.similar();
if (!similar) {
exampleText = exampleText.replace(" xmlns=\"http://hl7.org/fhir\"", "");
encodedXml = encodedXml.replace(" xmlns=\"http://hl7.org/fhir\"", "");
if (exampleText.length() != encodedXml.length()) {
// ourLog.info("Expected: " + exampleText);
// ourLog.info("Actual : " + encodedXml);
assertTrue(d.toString(), similar);
}
}
}
} finally {
is.close();
}
}
private String cleanXml(String exampleText) throws Error, Exception {
XMLEventReader read = XmlUtil.createXmlReader(new StringReader(exampleText));
StringWriter sw = new StringWriter();
XMLEventWriter write = XmlUtil.createXmlWriter(sw);
while (read.hasNext()) {
XMLEvent nextEvent = read.nextEvent();
if (nextEvent.getEventType() == XMLStreamConstants.COMMENT) {
continue;
}
write.add(nextEvent);
}
write.add(read);
sw.close();
return sw.toString().replaceAll("<!--.*-->", "").replace("\n", " ").replace("\r", " ").replaceAll(">\\s+<", "><").replaceAll("<\\?.*\\?>", "").replaceAll("\\s+", " ");
}
}

View File

@ -1,32 +1,16 @@
package ca.uhn.fhir.parser;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.stringContainsInOrder;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assert.*;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.*;
import java.io.IOException;
import java.io.StringReader;
import java.nio.charset.StandardCharsets;
import java.util.*;
import org.apache.commons.io.IOUtils;
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.XMLUnit;
import org.hamcrest.collection.IsEmptyCollection;
import org.hamcrest.core.StringContains;
import org.hamcrest.text.StringContainsInOrder;
@ -46,6 +30,9 @@ import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import org.junit.*;
import org.mockito.ArgumentCaptor;
import org.xmlunit.builder.DiffBuilder;
import org.xmlunit.builder.Input;
import org.xmlunit.diff.*;
import com.google.common.collect.Sets;
@ -1814,8 +1801,7 @@ public class XmlParserDstu2_1Test {
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
ourLog.info(reencoded);
Diff d = new Diff(new StringReader(content), new StringReader(reencoded));
assertTrue(d.toString(), d.identical());
compareXml(content, reencoded);
}
@ -1852,9 +1838,7 @@ public class XmlParserDstu2_1Test {
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
ourLog.info(reencoded);
Diff d = new Diff(new StringReader(content), new StringReader(reencoded));
assertTrue(d.toString(), d.identical());
compareXml(content, reencoded);
}
@Test
@ -2510,8 +2494,7 @@ public class XmlParserDstu2_1Test {
String reEncoded = p.encodeResourceToString(b);
ourLog.info(reEncoded);
Diff d = new Diff(new StringReader(bundle), new StringReader(reEncoded));
assertTrue(d.toString(), d.identical());
compareXml(bundle, reEncoded);
}
@ -2684,11 +2667,17 @@ public class XmlParserDstu2_1Test {
TestUtil.clearAllStaticFieldsForUnitTest();
}
@BeforeClass
public static void beforeClass() {
XMLUnit.setIgnoreAttributeOrder(true);
XMLUnit.setIgnoreComments(true);
XMLUnit.setIgnoreWhitespace(true);
public static void compareXml(String content, String reEncoded) {
Diff d = DiffBuilder.compare(Input.fromString(content))
.withTest(Input.fromString(reEncoded))
.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))
.checkForSimilar()
.ignoreWhitespace()
.ignoreComments()
.withComparisonController(ComparisonControllers.Default)
.build();
assertTrue(d.toString(), !d.hasDifferences());
}
public static void main(String[] args) {

View File

@ -52,8 +52,8 @@
<!-- Testing -->
<!-- <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-structures-dstu</artifactId> <version>0.8</version> <scope>test</scope> </dependency> -->
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -1,120 +0,0 @@
package ca.uhn.fhir.parser;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLEventWriter;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.events.XMLEvent;
import org.custommonkey.xmlunit.DetailedDiff;
import org.custommonkey.xmlunit.Diff;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.AfterClass;
import org.junit.Test;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.util.TestUtil;
import ca.uhn.fhir.util.XmlUtil;
public class RoundTripDstu2Test {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(RoundTripDstu2Test.class);
private static FhirContext ourCtx = FhirContext.forDstu2();
@AfterClass
public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest();
}
@Test
public void testIt() {
// Just so this doesn't complain until we enable roundtrip test
}
// @Test
public void testRoundTrip() throws Exception {
ZipInputStream is = new ZipInputStream(new FileInputStream("src/test/resources/examples.zip"));
try {
while (true) {
ZipEntry nextEntry = is.getNextEntry();
if (nextEntry == null) {
break;
}
ByteArrayOutputStream oos = new ByteArrayOutputStream();
byte[] buffer = new byte[2048];
int len = 0;
while ((len = is.read(buffer)) > 0) {
oos.write(buffer, 0, len);
}
String exampleText = oos.toString("UTF-8");
ourLog.info("Next file: {} - Size: {} bytes", nextEntry.getName(), exampleText.length());
if (!nextEntry.getName().contains("diagnosticreport-examples-lab")) {
continue;
}
IBaseResource parsed = ourCtx.newXmlParser().parseResource(exampleText);
String encodedXml = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
exampleText = cleanXml(exampleText);
encodedXml = cleanXml(encodedXml);
DetailedDiff d = new DetailedDiff(new Diff(new StringReader(exampleText), new StringReader(encodedXml)));
// d.overrideDifferenceListener(new DifferenceListener() {
//
// @Override
// public void skippedComparison(Node theControl, Node theTest) {
// ourLog.info("" + theControl);
// }
//
// @Override
// public int differenceFound(Difference theDifference) {
// ourLog.info("" + theDifference);
// return 0;
// }
// });
boolean similar = d.similar();
if (!similar) {
exampleText = exampleText.replace(" xmlns=\"http://hl7.org/fhir\"", "");
encodedXml = encodedXml.replace(" xmlns=\"http://hl7.org/fhir\"", "");
if (exampleText.length() != encodedXml.length()) {
// ourLog.info("Expected: " + exampleText);
// ourLog.info("Actual : " + encodedXml);
assertTrue(d.toString(), similar);
}
}
}
} finally {
is.close();
}
}
private String cleanXml(String exampleText) throws Error, Exception {
XMLEventReader read = XmlUtil.createXmlReader(new StringReader(exampleText));
StringWriter sw = new StringWriter();
XMLEventWriter write = XmlUtil.createXmlWriter(sw);
while (read.hasNext()) {
XMLEvent nextEvent = read.nextEvent();
if (nextEvent.getEventType() == XMLStreamConstants.COMMENT) {
continue;
}
write.add(nextEvent);
}
write.add(read);
sw.close();
return sw.toString().replaceAll("<!--.*-->", "").replace("\n", " ").replace("\r", " ").replaceAll(">\\s+<", "><").replaceAll("<\\?.*\\?>", "").replaceAll("\\s+", " ");
}
}

View File

@ -1,23 +1,9 @@
package ca.uhn.fhir.parser;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.emptyOrNullString;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.stringContainsInOrder;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.*;
import java.io.IOException;
import java.io.StringReader;
@ -25,17 +11,19 @@ import java.nio.charset.StandardCharsets;
import java.util.*;
import org.apache.commons.io.IOUtils;
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.XMLUnit;
import org.hamcrest.collection.IsEmptyCollection;
import org.hamcrest.core.StringContains;
import org.hamcrest.text.StringContainsInOrder;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import org.junit.*;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.answers.ThrowsException;
import org.xmlunit.builder.DiffBuilder;
import org.xmlunit.builder.Input;
import org.xmlunit.diff.*;
import com.google.common.collect.Sets;
@ -1933,8 +1921,7 @@ public class XmlParserDstu2Test {
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
ourLog.info(reencoded);
Diff d = new Diff(new StringReader(content), new StringReader(reencoded));
assertTrue(d.toString(), d.identical());
compareXml(content, reencoded);
}
@ -1970,8 +1957,7 @@ public class XmlParserDstu2Test {
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
ourLog.info(reencoded);
Diff d = new Diff(new StringReader(content), new StringReader(reencoded));
assertTrue(d.toString(), d.identical());
compareXml(content, reencoded);
}
@ -2624,9 +2610,7 @@ public class XmlParserDstu2Test {
ourLog.info(reEncoded);
Diff d = new Diff(new StringReader(bundle), new StringReader(reEncoded));
assertTrue(d.toString(), d.identical());
compareXml(bundle, reEncoded);
}
@Test
@ -2811,12 +2795,6 @@ public class XmlParserDstu2Test {
TestUtil.clearAllStaticFieldsForUnitTest();
}
@BeforeClass
public static void beforeClass() {
XMLUnit.setIgnoreAttributeOrder(true);
XMLUnit.setIgnoreComments(true);
XMLUnit.setIgnoreWhitespace(true);
}
public static void main(String[] args) {
IGenericClient c = ourCtx.newRestfulGenericClient("http://fhir-dev.healthintersections.com.au/open");
@ -2858,4 +2836,17 @@ public class XmlParserDstu2Test {
}
}
public static void compareXml(String content, String reEncoded) {
Diff d = DiffBuilder.compare(Input.fromString(content))
.withTest(Input.fromString(reEncoded))
.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))
.checkForSimilar()
.ignoreWhitespace()
.ignoreComments()
.withComparisonController(ComparisonControllers.Default)
.build();
assertTrue(d.toString(), !d.hasDifferences());
}
}

View File

@ -109,12 +109,6 @@ public class ETagClientDstu2Test {
lm.setTimeZoneZulu(true);
assertEquals("1995-11-15T04:58:08.000Z", lm.getValueAsString());
TagList tags = ResourceMetadataKeyEnum.TAG_LIST.get(response);
assertNotNull(tags);
assertEquals(1, tags.size());
assertEquals("http://foo/tagdefinition.html", tags.get(0).getTerm());
assertEquals("http://hl7.org/fhir/tag", tags.get(0).getScheme());
assertEquals("Some tag", tags.get(0).getLabel());
}
@Test

View File

@ -93,8 +93,8 @@
<!-- Testing -->
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -1,21 +1,12 @@
package ca.uhn.fhir.parser;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLEventWriter;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.*;
import javax.xml.stream.events.XMLEvent;
import org.custommonkey.xmlunit.DetailedDiff;
import org.custommonkey.xmlunit.Diff;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.AfterClass;
import org.junit.Test;
@ -68,31 +59,17 @@ public class RoundTripDstu3Test {
exampleText = cleanXml(exampleText);
encodedXml = cleanXml(encodedXml);
DetailedDiff d = new DetailedDiff(new Diff(new StringReader(exampleText), new StringReader(encodedXml)));
// d.overrideDifferenceListener(new DifferenceListener() {
XmlParserDstu3Test.compareXml(exampleText, encodedXml);
// DetailedDiff d = new DetailedDiff(new Diff(new StringReader(exampleText), new StringReader(encodedXml)));
//
// @Override
// public void skippedComparison(Node theControl, Node theTest) {
// ourLog.info("" + theControl);
// boolean similar = d.similar();
// if (!similar) {
// exampleText = exampleText.replace(" xmlns=\"http://hl7.org/fhir\"", "");
// encodedXml = encodedXml.replace(" xmlns=\"http://hl7.org/fhir\"", "");
// if (exampleText.length() != encodedXml.length()) {
// assertTrue(d.toString(), similar);
// }
//
// @Override
// public int differenceFound(Difference theDifference) {
// ourLog.info("" + theDifference);
// return 0;
// }
// });
boolean similar = d.similar();
if (!similar) {
exampleText = exampleText.replace(" xmlns=\"http://hl7.org/fhir\"", "");
encodedXml = encodedXml.replace(" xmlns=\"http://hl7.org/fhir\"", "");
if (exampleText.length() != encodedXml.length()) {
// ourLog.info("Expected: " + exampleText);
// ourLog.info("Actual : " + encodedXml);
assertTrue(d.toString(), similar);
}
}
}

View File

@ -29,8 +29,6 @@ import java.util.*;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.XMLUnit;
import org.hamcrest.collection.IsEmptyCollection;
import org.hamcrest.core.StringContains;
import org.hamcrest.text.StringContainsInOrder;
@ -54,6 +52,9 @@ import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import org.junit.*;
import org.mockito.ArgumentCaptor;
import org.xmlunit.builder.DiffBuilder;
import org.xmlunit.builder.Input;
import org.xmlunit.diff.*;
import com.google.common.collect.Sets;
@ -1571,7 +1572,8 @@ public class XmlParserDstu3Test {
ourLog.info(encoded);
assertThat(encoded, containsString("<Patient"));
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_SYSTEM + "\"/>", "<code value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_CODE + "\"/>", "</tag>"));
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_SYSTEM + "\"/>",
"<code value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_CODE + "\"/>", "</tag>"));
assertThat(encoded, not(containsString("text")));
assertThat(encoded, not(containsString("THE DIV")));
assertThat(encoded, containsString("family"));
@ -1717,7 +1719,8 @@ public class XmlParserDstu3Test {
ourLog.info(encoded);
assertThat(encoded, containsString("<Patient"));
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_SYSTEM + "\"/>", "<code value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_CODE + "\"/>", "</tag>"));
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_SYSTEM + "\"/>",
"<code value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_CODE + "\"/>", "</tag>"));
assertThat(encoded, not(containsString("THE DIV")));
assertThat(encoded, containsString("family"));
assertThat(encoded, not(containsString("maritalStatus")));
@ -1738,7 +1741,8 @@ public class XmlParserDstu3Test {
assertThat(encoded, containsString("<Patient"));
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"foo\"/>", "<code value=\"bar\"/>", "</tag>"));
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_SYSTEM + "\"/>", "<code value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_CODE + "\"/>", "</tag>"));
assertThat(encoded, stringContainsInOrder("<tag>", "<system value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_SYSTEM + "\"/>",
"<code value=\"" + ca.uhn.fhir.rest.api.Constants.TAG_SUBSETTED_CODE + "\"/>", "</tag>"));
assertThat(encoded, not(containsString("THE DIV")));
assertThat(encoded, containsString("family"));
assertThat(encoded, not(containsString("maritalStatus")));
@ -2130,8 +2134,7 @@ public class XmlParserDstu3Test {
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
ourLog.info(reencoded);
Diff d = new Diff(new StringReader(content), new StringReader(reencoded));
assertTrue(d.toString(), d.identical());
compareXml(content, reencoded);
}
@ -2168,8 +2171,7 @@ public class XmlParserDstu3Test {
String reencoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(parsed);
ourLog.info(reencoded);
Diff d = new Diff(new StringReader(content), new StringReader(reencoded));
assertTrue(d.toString(), d.identical());
compareXml(content, reencoded);
}
@ -2994,7 +2996,7 @@ public class XmlParserDstu3Test {
@Test
public void testParseMetadata() throws Exception {
String bundle = "<Bundle xmlns=\"http://hl7.org/fhir\">\n" +
String content = "<Bundle xmlns=\"http://hl7.org/fhir\">\n" +
" <total value=\"1\"/>\n" +
" <link>\n" +
" <relation value=\"self\"/>\n" +
@ -3023,7 +3025,7 @@ public class XmlParserDstu3Test {
" </entry>\n" +
"</Bundle>";
Bundle b = ourCtx.newXmlParser().parseResource(Bundle.class, bundle);
Bundle b = ourCtx.newXmlParser().parseResource(Bundle.class, content);
assertEquals(1, b.getEntry().size());
BundleEntryComponent entry = b.getEntry().get(0);
@ -3040,11 +3042,23 @@ public class XmlParserDstu3Test {
String reEncoded = p.encodeResourceToString(b);
ourLog.info(reEncoded);
Diff d = new Diff(new StringReader(bundle), new StringReader(reEncoded));
assertTrue(d.toString(), d.identical());
compareXml(content, reEncoded);
}
public static void compareXml(String content, String reEncoded) {
Diff d = DiffBuilder.compare(Input.fromString(content))
.withTest(Input.fromString(reEncoded))
.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))
.checkForSimilar()
.ignoreWhitespace() // this is working with newest Saxon 9.8.0-2 (not worked with 9.7.0-15
.ignoreComments() // this is not working even with newest Saxon 9.8.0-2
.withComparisonController(ComparisonControllers.Default)
.build();
assertTrue(d.toString(), !d.hasDifferences());
}
@Test
public void testParseMetaUpdatedDate() {
@ -3325,13 +3339,6 @@ public class XmlParserDstu3Test {
TestUtil.clearAllStaticFieldsForUnitTest();
}
@BeforeClass
public static void beforeClass() {
XMLUnit.setIgnoreAttributeOrder(true);
XMLUnit.setIgnoreComments(true);
XMLUnit.setIgnoreWhitespace(true);
}
public static void main(String[] args) {
IGenericClient c = ourCtx.newRestfulGenericClient("http://fhir-dev.healthintersections.com.au/open");
// c.registerInterceptor(new LoggingInterceptor(true));

View File

@ -343,7 +343,7 @@ public class BaseDateTimeTypeDstu3Test {
public void testLargePrecision() {
DateTimeType dt = new DateTimeType("2014-03-06T22:09:58.9121174+04:30");
myDateInstantParser.setTimeZone(TimeZone.getTimeZone("Z"));
myDateInstantParser.setTimeZone(TimeZone.getTimeZone("GMT"));
assertEquals("2014-03-06 17:39:58.912", myDateInstantParser.format(dt.getValue()));
}

View File

@ -71,8 +71,8 @@
<!-- Testing -->
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -1,16 +1,7 @@
package ca.uhn.fhir.parser;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.stringContainsInOrder;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.io.*;
import java.nio.charset.Charset;
@ -18,7 +9,6 @@ import java.util.Arrays;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.custommonkey.xmlunit.Diff;
import org.hamcrest.core.IsNot;
import org.hamcrest.core.StringContains;
import org.hamcrest.text.StringContainsInOrder;
@ -38,7 +28,6 @@ import org.junit.*;
import org.xml.sax.SAXException;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.TagList;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.ResourceDef;
import ca.uhn.fhir.narrative.INarrativeGenerator;
@ -1281,9 +1270,7 @@ public class JsonParserHl7OrgDstu2Test {
String expected = (xmlString);
String actual = (encoded.trim());
Diff d = new Diff(new StringReader(expected), new StringReader(actual));
assertTrue(d.toString(), d.identical());
XmlParserHl7OrgDstu2Test.compareXml(expected, actual);
}

View File

@ -1,23 +1,13 @@
package ca.uhn.fhir.parser;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.stringContainsInOrder;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.io.*;
import java.nio.charset.Charset;
import java.util.*;
import org.apache.commons.io.IOUtils;
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.XMLUnit;
import org.hamcrest.core.IsNot;
import org.hamcrest.core.StringContains;
import org.hamcrest.text.StringContainsInOrder;
@ -32,6 +22,9 @@ import org.hl7.fhir.instance.model.Narrative.NarrativeStatus;
import org.hl7.fhir.instance.model.api.*;
import org.junit.*;
import org.xml.sax.SAXException;
import org.xmlunit.builder.DiffBuilder;
import org.xmlunit.builder.Input;
import org.xmlunit.diff.*;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.context.FhirContext;
@ -1352,12 +1345,10 @@ public class XmlParserHl7OrgDstu2Test {
ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(patient));
Diff d = new Diff(new StringReader(msg), new StringReader(encoded));
ourLog.info("Expected: {}", msg);
ourLog.info("Actual: {}", encoded);
assertTrue(d.toString(), d.identical());
compareXml(msg, encoded);
}
@ -1396,8 +1387,7 @@ public class XmlParserHl7OrgDstu2Test {
String encoded = p.setPrettyPrint(true).encodeResourceToString(resource);
ourLog.info(encoded);
Diff d = new Diff(new StringReader(msg), new StringReader(encoded));
assertTrue(d.toString(), d.identical());
compareXml(msg, encoded);
}
@Test
@ -1437,8 +1427,7 @@ public class XmlParserHl7OrgDstu2Test {
String encoded = p.encodeResourceToString(resource);
ourLog.info(encoded);
Diff d = new Diff(new StringReader(msg), new StringReader(encoded));
assertTrue(d.toString(), d.identical());
compareXml(msg, encoded);
}
@Test
@ -1679,9 +1668,7 @@ public class XmlParserHl7OrgDstu2Test {
ourLog.info("Expected: {}", msg);
ourLog.info("Actual: {}", encoded1);
Diff d = new Diff(new StringReader(msg), new StringReader(encoded1));
assertTrue(d.toString(), d.identical());
compareXml(msg, encoded1);
}
@Test
@ -1709,9 +1696,7 @@ public class XmlParserHl7OrgDstu2Test {
String expected = (jsonString);
String actual = (encoded.trim());
Diff d = new Diff(new StringReader(expected), new StringReader(actual));
assertTrue(d.toString(), d.identical());
compareXml(expected, actual);
}
@Test
@ -1755,9 +1740,6 @@ public class XmlParserHl7OrgDstu2Test {
@BeforeClass
public static void beforeClass() {
XMLUnit.setIgnoreAttributeOrder(true);
XMLUnit.setIgnoreComments(true);
XMLUnit.setIgnoreWhitespace(true);
ourCtx = FhirContext.forDstu2Hl7Org();
}
@ -1784,4 +1766,17 @@ public class XmlParserHl7OrgDstu2Test {
}
}
public static void compareXml(String content, String reEncoded) {
Diff d = DiffBuilder.compare(Input.fromString(content))
.withTest(Input.fromString(reEncoded))
.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))
.checkForSimilar()
.ignoreWhitespace()
.ignoreComments()
.withComparisonController(ComparisonControllers.Default)
.build();
assertTrue(d.toString(), !d.hasDifferences());
}
}

View File

@ -74,8 +74,8 @@
<!-- Testing -->
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -1,30 +1,15 @@
package org.hl7.fhir.r4.elementmodel;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.exceptions.*;
import org.hl7.fhir.r4.conformance.ProfileUtilities;
import org.hl7.fhir.r4.context.IWorkerContext;
import org.hl7.fhir.r4.formats.IParser.OutputStyle;
import org.hl7.fhir.r4.model.Base;
import org.hl7.fhir.r4.model.CodeableConcept;
import org.hl7.fhir.r4.model.Coding;
import org.hl7.fhir.r4.model.ElementDefinition;
import org.hl7.fhir.r4.model.Factory;
import org.hl7.fhir.r4.model.PrimitiveType;
import org.hl7.fhir.r4.model.Resource;
import org.hl7.fhir.r4.model.StructureDefinition;
import org.hl7.fhir.r4.model.*;
import org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.r4.model.Type;
import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.exceptions.FHIRFormatError;
import org.hl7.fhir.utilities.TextFile;
import com.sun.corba.se.impl.ior.NewObjectKeyTemplateBase;
public class ObjectConverter {

View File

@ -29,6 +29,8 @@ import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import com.google.common.base.Charsets;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.ResourceDef;
@ -145,7 +147,7 @@ public class ClientR4Test {
assertEquals(HttpPost.class, capt.getValue().getClass());
HttpPost post = (HttpPost) capt.getValue();
assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString("<Patient"));
assertThat(IOUtils.toString(post.getEntity().getContent(), Charsets.UTF_8), StringContains.containsString("<Patient"));
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
assertEquals(EncodingEnum.XML.getResourceContentType() + Constants.HEADER_SUFFIX_CT_UTF_8, capt.getAllValues().get(0).getFirstHeader(Constants.HEADER_CONTENT_TYPE).getValue());
assertEquals("200", response.getId().getVersionIdPart());
@ -193,7 +195,7 @@ public class ClientR4Test {
assertEquals(HttpPost.class, capt.getValue().getClass());
HttpPost post = (HttpPost) capt.getValue();
assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString("<Patient"));
assertThat(IOUtils.toString(post.getEntity().getContent(), Charsets.UTF_8), StringContains.containsString("<Patient"));
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
assertEquals("200", response.getId().getVersionIdPart());
}
@ -250,14 +252,13 @@ public class ClientR4Test {
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8")));
ITestClient client = ourCtx.newRestfulClient(ITestClient.class, "http://foo");
BaseConformance response = client.getServerConformanceStatement();
CapabilityStatement response = (CapabilityStatement) client.getServerConformanceStatement();
assertEquals("http://foo/metadata", capt.getValue().getURI().toString());
assertEquals("Health Intersections", response.getPublisherElement().getValue());
}
@SuppressWarnings("deprecation")
@Test
public void testHistoryResourceInstance() throws Exception {
@ -279,7 +280,6 @@ public class ClientR4Test {
verifyHistoryBundleWithTwoResults(response);
}
@SuppressWarnings("deprecation")
@Test
public void testHistoryResourceType() throws Exception {
@ -298,7 +298,6 @@ public class ClientR4Test {
verifyHistoryBundleWithTwoResults(response);
}
@SuppressWarnings("deprecation")
@Test
public void testHistoryServer() throws Exception {
String msg = getHistoryBundleWithTwoResults();
@ -1036,7 +1035,7 @@ public class ClientR4Test {
assertEquals(HttpPut.class, capt.getValue().getClass());
HttpPut post = (HttpPut) capt.getValue();
assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/100"));
assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString("<Patient"));
assertThat(IOUtils.toString(post.getEntity().getContent(), Charsets.UTF_8), StringContains.containsString("<Patient"));
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
assertEquals("200", response.getId().getVersionIdPart());
assertEquals(EncodingEnum.XML.getResourceContentType() + Constants.HEADER_SUFFIX_CT_UTF_8, capt.getAllValues().get(0).getFirstHeader(Constants.HEADER_CONTENT_TYPE).getValue());
@ -1105,21 +1104,21 @@ public class ClientR4Test {
assertEquals(HttpPut.class, capt.getValue().getClass());
HttpPut post = (HttpPut) capt.getValue();
assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/100"));
assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString("<Patient"));
assertThat(IOUtils.toString(post.getEntity().getContent(), Charsets.UTF_8), StringContains.containsString("<Patient"));
assertThat(post.getFirstHeader(Constants.HEADER_LOCATION).getValue(), StringEndsWith.endsWith("Patient/100/_history/200"));
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
assertEquals("200", response.getId().getVersionIdPart());
}
@Test
public void testValidate() throws Exception {
public void testValidateNoContentResponse() throws Exception {
Patient patient = new Patient();
patient.addIdentifier().setSystem("urn:foo").setValue("123");
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse);
when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 201, "OK"));
when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), Constants.STATUS_HTTP_204_NO_CONTENT, "OK"));
when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_TEXT + "; charset=UTF-8"));
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(""), Charset.forName("UTF-8")));
when(myHttpResponse.getAllHeaders()).thenReturn(toHeaderArray("Location", "http://example.com/fhir/Patient/100/_history/200"));
@ -1129,13 +1128,42 @@ public class ClientR4Test {
assertEquals(HttpPost.class, capt.getValue().getClass());
HttpPost post = (HttpPost) capt.getValue();
assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/_validate"));
assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString("<Patient"));
assertEquals("http://example.com/fhir/Patient/100/_history/200", response.getId().getValue());
assertEquals("200", response.getId().getVersionIdPart());
assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/$validate"));
assertThat(IOUtils.toString(post.getEntity().getContent(), Charsets.UTF_8), StringContains.containsString("<Patient"));
assertNull(response.getOperationOutcome());
assertNull(response.getResource());
}
@Test
public void testValidateOutcomeResponse() throws Exception {
OperationOutcome oo = new OperationOutcome();
oo.addIssue().setDiagnostics("ALL GOOD");
String resp = ourCtx.newJsonParser().encodeResourceToString(oo);
Patient patient = new Patient();
patient.addIdentifier().setSystem("urn:foo").setValue("123");
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse);
when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK"));
when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_JSON_NEW + "; charset=UTF-8"));
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(resp), Charset.forName("UTF-8")));
when(myHttpResponse.getAllHeaders()).thenReturn(toHeaderArray("Location", "http://example.com/fhir/Patient/100/_history/200"));
ITestClient client = ourCtx.newRestfulClient(ITestClient.class, "http://foo");
MethodOutcome response = client.validatePatient(patient);
assertEquals(HttpPost.class, capt.getValue().getClass());
HttpPost post = (HttpPost) capt.getValue();
assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/$validate"));
assertThat(IOUtils.toString(post.getEntity().getContent(), Charsets.UTF_8), StringContains.containsString("<Patient"));
assertNotNull(response.getOperationOutcome());
assertEquals("ALL GOOD", ((OperationOutcome)response.getOperationOutcome()).getIssueFirstRep().getDiagnostics());
assertNull(response.getResource());
}
@Test
public void testVRead() throws Exception {

View File

@ -21,7 +21,6 @@ import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.base.resource.BaseOperationOutcome;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Read;
import ca.uhn.fhir.rest.api.Constants;
@ -144,7 +143,7 @@ public class ExceptionHandlingTest {
assertThat(e.getMessage(), StringContains.containsString("HTTP 500 Internal Error"));
assertThat(e.getMessage(), StringContains.containsString("Help I'm a bug"));
assertNotNull(e.getOperationOutcome());
assertEquals("Help I'm a bug", ((BaseOperationOutcome) e.getOperationOutcome()).getIssueFirstRep().getDetailsElement().getValue());
assertEquals("Help I'm a bug", ((OperationOutcome) e.getOperationOutcome()).getIssueFirstRep().getDiagnosticsElement().getValue());
}
}
@ -170,7 +169,7 @@ public class ExceptionHandlingTest {
assertThat(e.getMessage(), StringContains.containsString("HTTP 500 Internal Error"));
assertThat(e.getMessage(), StringContains.containsString("Help I'm a bug"));
assertNotNull(e.getOperationOutcome());
assertEquals("Help I'm a bug", ((BaseOperationOutcome) e.getOperationOutcome()).getIssueFirstRep().getDetailsElement().getValue());
assertEquals("Help I'm a bug", ((OperationOutcome) e.getOperationOutcome()).getIssueFirstRep().getDiagnosticsElement().getValue());
}
}

View File

@ -33,8 +33,8 @@ import ca.uhn.fhir.util.TestUtil;
public class IncludedResourceStitchingClientTest {
private FhirContext ctx;
private HttpClient httpClient;
private HttpResponse httpResponse;
private HttpClient myHttpClient;
private HttpResponse myHttpResponse;
// atom-document-large.xml
@ -42,20 +42,20 @@ public class IncludedResourceStitchingClientTest {
public void before() {
ctx = FhirContext.forR4();
httpClient = mock(HttpClient.class, new ReturnsDeepStubs());
ctx.getRestfulClientFactory().setHttpClient(httpClient);
myHttpClient = mock(HttpClient.class, new ReturnsDeepStubs());
ctx.getRestfulClientFactory().setHttpClient(myHttpClient);
ctx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
httpResponse = mock(HttpResponse.class, new ReturnsDeepStubs());
myHttpResponse = mock(HttpResponse.class, new ReturnsDeepStubs());
}
@Test
public void testWithParam() throws Exception {
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
when(httpClient.execute(capt.capture())).thenReturn(httpResponse);
when(httpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK"));
when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML_NEW + "; charset=UTF-8"));
when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(createBundle()), Charset.forName("UTF-8")));
when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse);
when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK"));
when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML_NEW + "; charset=UTF-8"));
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(createBundle()), Charset.forName("UTF-8")));
IGenericClient client = ctx.newRestfulGenericClient( "http://foo");
Bundle bundle = client
@ -84,10 +84,10 @@ public class IncludedResourceStitchingClientTest {
@Test
public void testWithDeclaredExtension() throws Exception {
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
when(httpClient.execute(capt.capture())).thenReturn(httpResponse);
when(httpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK"));
when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML_NEW + "; charset=UTF-8"));
when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(createLinkedBundle()), Charset.forName("UTF-8")));
when(myHttpClient.execute(capt.capture())).thenReturn(myHttpResponse);
when(myHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK"));
when(myHttpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML_NEW + "; charset=UTF-8"));
when(myHttpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(createLinkedBundle()), Charset.forName("UTF-8")));
IGenericClient client = ctx.newRestfulGenericClient( "http://foo");
Bundle bundle = client.search().forResource(IncludeTest.ExtPatient.class).returnBundle(Bundle.class).execute();
@ -115,12 +115,25 @@ public class IncludedResourceStitchingClientTest {
Patient p1 = new Patient();
p1.addIdentifier().setValue("p1");
p1.addExtension().setUrl("http://foo#secondOrg").setValue(new Reference("Organization/o1"));
bundle.addEntry().setResource(p1);
Patient p2 = new Patient();
p2.addIdentifier().setValue("p1");
p2.addIdentifier().setValue("p2");
p2.addExtension().setUrl("http://foo#secondOrg").setValue(new Reference("Organization/o1"));
bundle.addEntry().setResource(p2);
Organization o1 = new Organization();
o1.setId("o1");
o1.setName("o1");
o1.getPartOf().setReference("Organization/o2");
bundle.addEntry().setResource(o1);
Organization o2 = new Organization();
o2.setId("o2");
o2.setName("o2");
bundle.addEntry().setResource(o2);
return ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle);
// //@formatter:off
@ -200,65 +213,85 @@ public class IncludedResourceStitchingClientTest {
private String createBundle() {
//@formatter:on
return "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" +
" <title/>\n" +
" <id>f051fd86-4daa-48da-80f7-5a0443bf6f11</id>\n" +
" <link rel=\"self\" href=\"http://localhost:49627/Patient?_query=extInclude&amp;_pretty=true\"/>\n" +
" <link rel=\"fhir-base\" href=\"http://localhost:49627\"/>\n" +
" <os:totalResults xmlns:os=\"http://a9.com/-/spec/opensearch/1.1/\">2</os:totalResults>\n" +
" <author>\n" +
" <name>HAPI FHIR Server</name>\n" +
" </author>\n" +
" <entry>\n" +
" <title>Patient p1</title>\n" +
" <id>http://localhost:49627/Patient/p1</id>\n" +
" <published>2014-08-05T15:22:08-04:00</published>\n" +
" <link rel=\"self\" href=\"http://localhost:49627/Patient/p1\"/>\n" +
" <content type=\"text/xml\">\n" +
" <Patient xmlns=\"http://hl7.org/fhir\">\n" +
" <extension url=\"http://foo\">\n" +
" <valueResource>\n" +
" <reference value=\"Organization/o1\"/>\n" +
" </valueResource>\n" +
" </extension>\n" +
" <identifier>\n" +
" <label value=\"p1\"/>\n" +
" </identifier>\n" +
" </Patient>\n" +
" </content>\n" +
" </entry>\n" +
" <entry>\n" +
" <title>Patient p2</title>\n" +
" <id>http://localhost:49627/Patient/p2</id>\n" +
" <published>2014-08-05T15:22:08-04:00</published>\n" +
" <link rel=\"self\" href=\"http://localhost:49627/Patient/p2\"/>\n" +
" <content type=\"text/xml\">\n" +
" <Patient xmlns=\"http://hl7.org/fhir\">\n" +
" <extension url=\"http://foo\">\n" +
" <valueResource>\n" +
" <reference value=\"Organization/o1\"/>\n" +
" </valueResource>\n" +
" </extension>\n" +
" <identifier>\n" +
" <label value=\"p2\"/>\n" +
" </identifier>\n" +
" </Patient>\n" +
" </content>\n" +
" </entry>\n" +
" <entry>\n" +
" <title>Organization o1</title>\n" +
" <id>http://localhost:49627/Organization/o1</id>\n" +
" <published>2014-08-05T15:22:08-04:00</published>\n" +
" <link rel=\"self\" href=\"http://localhost:49627/Organization/o1\"/>\n" +
" <content type=\"text/xml\">\n" +
" <Organization xmlns=\"http://hl7.org/fhir\">\n" +
" <name value=\"o1\"/>\n" +
" </Organization>\n" +
" </content>\n" +
" </entry>\n" +
"</feed>";
//@formatter:off
Bundle bundle = new Bundle();
Patient p1 = new Patient();
p1.addIdentifier().setValue("p1");
p1.addExtension().setUrl("http://foo").setValue(new Reference("Organization/o1"));
bundle.addEntry().setResource(p1);
Patient p2 = new Patient();
p2.addIdentifier().setValue("p2");
p2.addExtension().setUrl("http://foo#secondOrg").setValue(new Reference("Organization/o1"));
bundle.addEntry().setResource(p2);
Organization o1 = new Organization();
o1.setId("o1");
o1.setName("o1");
o1.getPartOf().setReference("Organization/o2");
bundle.addEntry().setResource(o1);
return ctx.newXmlParser().encodeResourceToString(bundle);
// //@formatter:on
// return "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" +
// " <title/>\n" +
// " <id>f051fd86-4daa-48da-80f7-5a0443bf6f11</id>\n" +
// " <link rel=\"self\" href=\"http://localhost:49627/Patient?_query=extInclude&amp;_pretty=true\"/>\n" +
// " <link rel=\"fhir-base\" href=\"http://localhost:49627\"/>\n" +
// " <os:totalResults xmlns:os=\"http://a9.com/-/spec/opensearch/1.1/\">2</os:totalResults>\n" +
// " <author>\n" +
// " <name>HAPI FHIR Server</name>\n" +
// " </author>\n" +
// " <entry>\n" +
// " <title>Patient p1</title>\n" +
// " <id>http://localhost:49627/Patient/p1</id>\n" +
// " <published>2014-08-05T15:22:08-04:00</published>\n" +
// " <link rel=\"self\" href=\"http://localhost:49627/Patient/p1\"/>\n" +
// " <content type=\"text/xml\">\n" +
// " <Patient xmlns=\"http://hl7.org/fhir\">\n" +
// " <extension url=\"http://foo\">\n" +
// " <valueResource>\n" +
// " <reference value=\"Organization/o1\"/>\n" +
// " </valueResource>\n" +
// " </extension>\n" +
// " <identifier>\n" +
// " <label value=\"p1\"/>\n" +
// " </identifier>\n" +
// " </Patient>\n" +
// " </content>\n" +
// " </entry>\n" +
// " <entry>\n" +
// " <title>Patient p2</title>\n" +
// " <id>http://localhost:49627/Patient/p2</id>\n" +
// " <published>2014-08-05T15:22:08-04:00</published>\n" +
// " <link rel=\"self\" href=\"http://localhost:49627/Patient/p2\"/>\n" +
// " <content type=\"text/xml\">\n" +
// " <Patient xmlns=\"http://hl7.org/fhir\">\n" +
// " <extension url=\"http://foo\">\n" +
// " <valueResource>\n" +
// " <reference value=\"Organization/o1\"/>\n" +
// " </valueResource>\n" +
// " </extension>\n" +
// " <identifier>\n" +
// " <label value=\"p2\"/>\n" +
// " </identifier>\n" +
// " </Patient>\n" +
// " </content>\n" +
// " </entry>\n" +
// " <entry>\n" +
// " <title>Organization o1</title>\n" +
// " <id>http://localhost:49627/Organization/o1</id>\n" +
// " <published>2014-08-05T15:22:08-04:00</published>\n" +
// " <link rel=\"self\" href=\"http://localhost:49627/Organization/o1\"/>\n" +
// " <content type=\"text/xml\">\n" +
// " <Organization xmlns=\"http://hl7.org/fhir\">\n" +
// " <name value=\"o1\"/>\n" +
// " </Organization>\n" +
// " </content>\n" +
// " </entry>\n" +
// "</feed>";
// //@formatter:off
}

View File

@ -84,9 +84,9 @@ public class TransactionClientTest {
ourLog.info(ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle));
assertEquals(2, bundle.getEntry().size());
assertEquals("Patient/testPersistWithSimpleLinkP01", bundle.getEntry().get(0).getIdElement().getValue());
assertEquals("Patient/testPersistWithSimpleLinkP01", bundle.getEntry().get(0).getResource().getIdElement().getValue());
assertTrue(bundle.getEntry().get(1).getId().isEmpty());
assertTrue(bundle.getEntry().get(1).getResource().getIdElement().isEmpty());
}
@ -102,7 +102,7 @@ public class TransactionClientTest {
obs.setSubject(new Reference("Patient/testPersistWithSimpleLinkP01"));
Bundle transactionBundle = new Bundle();
transactionBundle.addEntry().setResource(patient);
transactionBundle.addEntry().setResource(patient).setFullUrl("http://foo/Patient/testPersistWithSimpleLinkP01");
transactionBundle.addEntry().setResource(obs);
IBundleClient client = ctx.newRestfulClient(IBundleClient.class, "http://foo");
@ -125,7 +125,7 @@ public class TransactionClientTest {
assertEquals(2, bundle.getEntry().size());
assertEquals("http://foo/Patient/testPersistWithSimpleLinkP01", bundle.getEntry().get(0).getResource().getIdElement().getValue());
assertTrue(bundle.getEntry().get(1).getId().isEmpty());
assertTrue(bundle.getEntry().get(1).getResource().getIdElement().isEmpty());
}

View File

@ -114,7 +114,7 @@ public class ZipGenerator {
public void addFiles(String actualDir, String statedDir, String ext, String noExt) throws FileNotFoundException, IOException {
byte data[] = new byte[BUFFER];
statedDir.replace("\\", "/");
statedDir = statedDir.replace("\\", "/");
File f = new CSFile(actualDir);
String files[] = f.list();
@ -136,7 +136,7 @@ public class ZipGenerator {
public void addFilesFiltered(String actualDir, String statedDir, String ext, String[] noExt) throws FileNotFoundException, IOException {
byte data[] = new byte[BUFFER];
statedDir.replace("\\", "/");
statedDir = statedDir.replace("\\", "/");
File f = new CSFile(actualDir);
String files[] = f.list();

View File

@ -167,7 +167,7 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
String html = Processor.process("[$PROFILE$]: extended\n" + md);
pieces.addAll(htmlToParagraphPieces(html));
} catch (Exception e) {
e = e;
e.printStackTrace();
}
return this;
}

66
pom.xml
View File

@ -368,8 +368,8 @@
<!-- Dependency Versions -->
<derby_version>10.13.1.1</derby_version>
<jersey_version>2.25.1</jersey_version>
<jetty_version>9.4.5.v20170502</jetty_version>
<hibernate_version>5.2.9.Final</hibernate_version>
<jetty_version>9.4.6.v20170531</jetty_version>
<hibernate_version>5.2.10.Final</hibernate_version>
<hibernate_validator_version>5.4.1.Final</hibernate_validator_version>
<!-- Update lucene version when you update hibernate-search version -->
<hibernate_search_version>5.7.0.Final</hibernate_search_version>
@ -378,10 +378,9 @@
<maven_license_plugin_version>1.8</maven_license_plugin_version>
<maven_source_plugin_version>2.4</maven_source_plugin_version>
<phloc_schematron_version>2.7.1</phloc_schematron_version>
<phloc_commons_version>4.4.6</phloc_commons_version>
<spring_version>4.3.7.RELEASE</spring_version>
<thymeleaf-version>3.0.2.RELEASE</thymeleaf-version>
<xmlunit_version>1.6</xmlunit_version>
<phloc_commons_version>4.4.11</phloc_commons_version>
<spring_version>4.3.10.RELEASE</spring_version>
<thymeleaf-version>3.0.7.RELEASE</thymeleaf-version>
<!-- We are aiming to still work on a very old version of SLF4j even though we depend on the newest, just to be nice to users of the API. This version is tested in the hapi-fhir-cobertura. -->
<slf4j_target_version>1.6.0</slf4j_target_version>
@ -400,7 +399,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.2</version>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>com.atlassian.commonmark</groupId>
@ -420,12 +419,12 @@
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.0.9</version>
<version>2.0.21</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>21.0</version>
<version>22.0</version>
</dependency>
<dependency>
<groupId>com.phloc</groupId>
@ -445,7 +444,7 @@
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.3.1</version>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
@ -497,7 +496,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
@ -560,12 +559,13 @@
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<!-- <version>9.8.0-3</version> -->
<version>9.5.1-5</version>
</dependency>
<dependency>
<groupId>net.ttddyy</groupId>
<artifactId>datasource-proxy</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
@ -580,7 +580,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
<version>3.6</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
@ -600,7 +600,7 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
@ -610,7 +610,7 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.5</version>
<version>4.4.6</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
@ -645,7 +645,7 @@
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-scm</artifactId>
<version>2.10</version>
<version>2.12</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@ -655,12 +655,12 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.2.5</version>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.2</version>
<version>3.5</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
@ -672,20 +672,25 @@
<artifactId>velocity-tools</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.22</version>
<version>3.0.24</version>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
@ -745,7 +750,7 @@
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>1.15</version>
<version>1.16</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
@ -908,9 +913,9 @@
<version>${thymeleaf-version}</version>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.6</version>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>xpp3</groupId>
@ -954,7 +959,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<version>3.6.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
@ -974,15 +979,20 @@
<artifactId>error_prone_core</artifactId>
<version>2.0.19</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>

View File

@ -7,6 +7,24 @@
</properties>
<body>
<release version="3.0" date="TBD">
<action type="add">
Bump the version of a few dependencies to the
latest versions (dependent HAPI modules listed in brackets):
<![CDATA[
<ul>
<li>Gson (JSON Parser): 2.8.0 -&gt; 2.8.1</li>
<li>Commons-lang3 (Everywhere): 3.5 -&gt; 3.6</li>
<!--<li>Saxon-HE (Validator): 9.5.1-5 -&gt; 9.8.0-3</li>-->
<li>Apache HttpClient (FHIR Client): 4.5.2 -&gt; 4.5.3</li>
<li>Apache HttpCore (FHIR Client): 4.4.5 -&gt; 4.4.6</li>
<li>Phloc Commons (Schematron Validator): 4.4.6 -&gt; 4.4.11</li>
<li>Hibernate (JPA): 5.2.9 -&gt; 5.2.10</li>
<li>Spring (JPA): 4.3.7.RELEASE -&gt; 4.3.10.RELEASE</li>
<li>Thymeleaf (Testpage Overlay): 3.0.2.RELEASE -&gt; 3.0.7.RELEASE</li>
</ul>
]]>
</action>
<action type="fix">
hapi-fhir-client-okhttp project POM had dependencies on both
hapi-fhir-structures-dstu2 and hapi-fhir-structures-dstu3, which