remove more NPE, fix old test

This commit is contained in:
Tadgh 2021-09-14 02:10:34 -04:00
parent fb8def21ae
commit 0a9d5344e3
2 changed files with 2 additions and 13 deletions

View File

@ -385,8 +385,8 @@ class RuleImplOp extends BaseRule /* implements IAuthRule */ {
List<RuntimeSearchParam> params = sourceDef.getSearchParamsForCompartmentName(compartmentOwnerResourceType); List<RuntimeSearchParam> params = sourceDef.getSearchParamsForCompartmentName(compartmentOwnerResourceType);
Set<String> additionalParamNames = myAdditionalCompartmentSearchParamMap.get(sourceDef.getName().toLowerCase()); Set<String> additionalParamNames = myAdditionalCompartmentSearchParamMap.getOrDefault(sourceDef.getName().toLowerCase(), new HashSet<>());
List<RuntimeSearchParam> additionalParams = additionalParamNames.stream().map(paramName -> sourceDef.getSearchParam(paramName)).collect(Collectors.toList()); List<RuntimeSearchParam> additionalParams = additionalParamNames.stream().map(sourceDef::getSearchParam).collect(Collectors.toList());
if (params == null || params.isEmpty()) { if (params == null || params.isEmpty()) {
params = additionalParams; params = additionalParams;
} else { } else {

View File

@ -480,17 +480,6 @@ public class AuthorizationInterceptorR4Test {
carePlan = new CarePlan(); carePlan = new CarePlan();
carePlan.setStatus(CarePlan.CarePlanStatus.ACTIVE); carePlan.setStatus(CarePlan.CarePlanStatus.ACTIVE);
carePlan.getSubject().setResource(patient); carePlan.getSubject().setResource(patient);
Device d = new Device();
d.getPatient().setResource(patient);
ourHitMethod = false;
ourReturn = Collections.singletonList(d);
httpGet = new HttpGet("http://localhost:" + ourPort + "/Device/123456");
status = ourClient.execute(httpGet);
extractResponseAndClose(status);
assertEquals(200, status.getStatusLine().getStatusCode());
assertTrue(ourHitMethod);
} }
/** /**