Skip to content

Commit

Permalink
issue #3265 - checkType throws instead of logging for abstract types
Browse files Browse the repository at this point in the history
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
  • Loading branch information
lmsurpre committed Apr 8, 2022
1 parent 3fe5394 commit 4f23fa2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void testReindexWithInvalidType() {
.header("X-FHIR-DSID", "default")
.post(entity, Response.class);

assertEquals(r.getStatus(), Status.BAD_REQUEST.getStatusCode());
assertEquals(r.getStatus(), Status.NOT_FOUND.getStatusCode());
}

@Test(groups = { "reindex" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@ public void testRetrieveIndex_invalidType() {
.header("X-FHIR-DSID", "default")
.post(entity, Response.class);

assertEquals(r.getStatus(), Status.BAD_REQUEST.getStatusCode());
assertEquals(r.getStatus(), Status.NOT_FOUND.getStatusCode());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,8 @@ protected void checkInitComplete() throws FHIROperationException {
* we'll throw an error to short-circuit the current in-progress REST API invocation.
*/
protected void checkType(String type) throws FHIROperationException {
if (!ModelSupport.isResourceType(type)) {
throw buildUnsupportedResourceTypeException(type);
}
if (!ModelSupport.isConcreteResourceType(type)) {
log.warning("Use of abstract resource types like '" + type + "' in FHIR URLs is deprecated and will be removed in a future release");
throw buildUnsupportedResourceTypeException(type);
}
}

Expand Down

0 comments on commit 4f23fa2

Please sign in to comment.