Test fix
This commit is contained in:
parent
bb4cbb6af5
commit
718c248c69
|
@ -315,8 +315,7 @@ class PredicateBuilderReference extends BasePredicateBuilder {
|
|||
}
|
||||
|
||||
// Handle chain on _type
|
||||
String chain = theReferenceParam.getChain();
|
||||
if (Constants.PARAM_TYPE.equals(chain)) {
|
||||
if (Constants.PARAM_TYPE.equals(theReferenceParam.getChain())) {
|
||||
String typeValue = theReferenceParam.getValue();
|
||||
|
||||
Class<? extends IBaseResource> wantedType;
|
||||
|
@ -326,8 +325,7 @@ class PredicateBuilderReference extends BasePredicateBuilder {
|
|||
throw newInvalidResourceTypeException(typeValue);
|
||||
}
|
||||
if (!resourceTypes.contains(wantedType)) {
|
||||
InvalidRequestException invalidRequestException = newInvalidTargetTypeForChainException(theResourceName, theParamName, typeValue);
|
||||
throw invalidRequestException;
|
||||
throw newInvalidTargetTypeForChainException(theResourceName, theParamName, typeValue);
|
||||
}
|
||||
|
||||
Predicate targetTypeParameter = myCriteriaBuilder.equal(theJoin.get("myTargetResourceType"), typeValue);
|
||||
|
@ -338,6 +336,7 @@ class PredicateBuilderReference extends BasePredicateBuilder {
|
|||
boolean foundChainMatch = false;
|
||||
List<Class<? extends IBaseResource>> candidateTargetTypes = new ArrayList<>();
|
||||
for (Class<? extends IBaseResource> nextType : resourceTypes) {
|
||||
String chain = theReferenceParam.getChain();
|
||||
|
||||
String remainingChain = null;
|
||||
int chainDotIndex = chain.indexOf('.');
|
||||
|
|
|
@ -346,7 +346,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
|
|||
.returnBundle(Bundle.class)
|
||||
.execute();
|
||||
} catch (InvalidRequestException e) {
|
||||
assertEquals("HTTP 400 Bad Request: Invalid resource type: FOO", e.getMessage());
|
||||
assertEquals("HTTP 400 Bad Request: Invalid/unsupported resource type: \"FOO\"", e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -405,15 +405,15 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
|
|||
assertThat(idValues, contains(pid));
|
||||
|
||||
// Search param on extension
|
||||
myCaptureQueriesListener.clear();
|
||||
idValues = searchAndReturnUnqualifiedIdValues(ourServerBase + "/Patient?extpatorg=" + orgId.getValue());
|
||||
myCaptureQueriesListener.logSelectQueries();
|
||||
assertThat(idValues, contains(pid));
|
||||
|
||||
idValues = searchAndReturnUnqualifiedIdValues(ourServerBase + "/Patient?extpatorg.name=ORGANIZATION");
|
||||
assertThat(idValues, contains(pid));
|
||||
|
||||
myCaptureQueriesListener.clear();
|
||||
idValues = searchAndReturnUnqualifiedIdValues(ourServerBase + "/Patient?extpatorg.extorgorg.name=PARENT");
|
||||
myCaptureQueriesListener.logSelectQueries();
|
||||
assertThat(idValues, contains(pid));
|
||||
|
||||
idValues = searchAndReturnUnqualifiedIdValues(ourServerBase + "/Patient?extpatorg.extorgorg.extorgorg.name=GRANDPARENT");
|
||||
|
|
Loading…
Reference in New Issue