From 5bbf8686f88c3420764ace7b3d5a9ecb146d6335 Mon Sep 17 00:00:00 2001 From: Eugene Lubarsky Date: Fri, 19 May 2017 20:28:05 +1000 Subject: [PATCH] Fix for ResponseHighlightingInterceptorTest breakage --- .../ResponseHighlightingInterceptorTest.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlightingInterceptorTest.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlightingInterceptorTest.java index f3927bbaddb..180c9b6c589 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlightingInterceptorTest.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlightingInterceptorTest.java @@ -213,7 +213,7 @@ public class ResponseHighlightingInterceptorTest { Patient resource = new Patient(); resource.addName().addFamily("FAMILY"); - ServletRequestDetails reqDetails = new ServletRequestDetails(); + ServletRequestDetails reqDetails = new TestServletRequestDetails(); reqDetails.setRequestType(RequestTypeEnum.GET); reqDetails.setServer(new RestfulServer(ourCtx)); reqDetails.setServletRequest(req); @@ -251,7 +251,7 @@ public class ResponseHighlightingInterceptorTest { Patient resource = new Patient(); resource.addName().addFamily("FAMILY"); - ServletRequestDetails reqDetails = new ServletRequestDetails(); + ServletRequestDetails reqDetails = new TestServletRequestDetails(); reqDetails.setRequestType(RequestTypeEnum.GET); HashMap params = new HashMap(); params.put(Constants.PARAM_PRETTY, new String[] { Constants.PARAM_PRETTY_VALUE_TRUE }); @@ -286,7 +286,7 @@ public class ResponseHighlightingInterceptorTest { Patient resource = new Patient(); resource.addName().addFamily("FAMILY"); - ServletRequestDetails reqDetails = new ServletRequestDetails(); + ServletRequestDetails reqDetails = new TestServletRequestDetails(); reqDetails.setRequestType(RequestTypeEnum.GET); HashMap params = new HashMap(); params.put(Constants.PARAM_PRETTY, new String[] { Constants.PARAM_PRETTY_VALUE_TRUE }); @@ -326,7 +326,7 @@ public class ResponseHighlightingInterceptorTest { Patient resource = new Patient(); resource.addName().addFamily("FAMILY"); - ServletRequestDetails reqDetails = new ServletRequestDetails(); + ServletRequestDetails reqDetails = new TestServletRequestDetails(); reqDetails.setRequestType(RequestTypeEnum.GET); HashMap params = new HashMap(); reqDetails.setParameters(params); @@ -360,7 +360,7 @@ public class ResponseHighlightingInterceptorTest { Patient resource = new Patient(); resource.addName().addFamily("FAMILY"); - ServletRequestDetails reqDetails = new ServletRequestDetails(); + ServletRequestDetails reqDetails = new TestServletRequestDetails(); reqDetails.setRequestType(RequestTypeEnum.GET); HashMap params = new HashMap(); params.put(Constants.PARAM_FORMAT, new String[] { Constants.FORMAT_HTML }); @@ -394,7 +394,7 @@ public class ResponseHighlightingInterceptorTest { Patient resource = new Patient(); resource.addName().addFamily("FAMILY"); - ServletRequestDetails reqDetails = new ServletRequestDetails(); + ServletRequestDetails reqDetails = new TestServletRequestDetails(); reqDetails.setRequestType(RequestTypeEnum.GET); HashMap params = new HashMap(); params.put(Constants.PARAM_FORMAT, new String[] { Constants.CT_HTML }); @@ -425,7 +425,7 @@ public class ResponseHighlightingInterceptorTest { Patient resource = new Patient(); resource.addName().addFamily("FAMILY"); - ServletRequestDetails reqDetails = new ServletRequestDetails(); + ServletRequestDetails reqDetails = new TestServletRequestDetails(); reqDetails.setRequestType(RequestTypeEnum.GET); reqDetails.setParameters(new HashMap()); reqDetails.setServer(new RestfulServer(ourCtx)); @@ -463,7 +463,7 @@ public class ResponseHighlightingInterceptorTest { Patient resource = new Patient(); resource.addName().addFamily("FAMILY"); - ServletRequestDetails reqDetails = new ServletRequestDetails(); + ServletRequestDetails reqDetails = new TestServletRequestDetails(); reqDetails.setRequestType(RequestTypeEnum.GET); reqDetails.setParameters(new HashMap()); RestfulServer server = new RestfulServer(ourCtx); @@ -501,7 +501,7 @@ public class ResponseHighlightingInterceptorTest { Patient resource = new Patient(); resource.addName().addFamily("FAMILY"); - ServletRequestDetails reqDetails = new ServletRequestDetails(); + ServletRequestDetails reqDetails = new TestServletRequestDetails(); reqDetails.setRequestType(RequestTypeEnum.GET); reqDetails.setParameters(new HashMap()); RestfulServer server = new RestfulServer(ourCtx); @@ -867,4 +867,11 @@ public class ResponseHighlightingInterceptorTest { } + class TestServletRequestDetails extends ServletRequestDetails { + @Override + public String getServerBaseForRequest() { + return "/baseDstu3"; + } + } + }