From 6cbe11402fe3af52dc7e274a747ed7db792813cd Mon Sep 17 00:00:00 2001 From: Martha Mitran Date: Thu, 19 Dec 2024 10:24:26 -0800 Subject: [PATCH] Expose ConsentInterceptor#getConsentService for integration test purposes (#6527) * Expose ConsentInterceptor#getConsentService for integration test purpose. * Address code review comment. --- .../rest/server/interceptor/consent/ConsentInterceptor.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/consent/ConsentInterceptor.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/consent/ConsentInterceptor.java index 41029b1bdac..fa30f91cfe5 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/consent/ConsentInterceptor.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/consent/ConsentInterceptor.java @@ -40,6 +40,7 @@ import ca.uhn.fhir.rest.server.interceptor.auth.AuthorizationConstants; import ca.uhn.fhir.rest.server.util.ICachedSearchDetails; import ca.uhn.fhir.util.BundleUtil; import ca.uhn.fhir.util.IModelVisitor2; +import com.google.common.annotations.VisibleForTesting; import jakarta.annotation.Nonnull; import jakarta.annotation.Nullable; import org.apache.commons.lang3.Validate; @@ -157,6 +158,11 @@ public class ConsentInterceptor { return this; } + @VisibleForTesting + public List getConsentServices() { + return Collections.unmodifiableList(myConsentService); + } + @Hook(value = Pointcut.SERVER_INCOMING_REQUEST_PRE_HANDLED) public void interceptPreHandled(RequestDetails theRequestDetails) { if (isSkipServiceForRequest(theRequestDetails)) {