Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
Description
HstSitePipeline seems to try to cast the input requestContext to MockHstRequestContext implicitly.
So, if you use MockHstRequestContext in your unit tests, it causes a ClassCastException like the following logs:
java.lang.ClassCastException: org.hippoecm.hst.mock.core.request.MockHstRequestContext cannot be cast to org.hippoecm.hst.core.internal.HstMutableRequestContext
at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.<init>(HstSitePipeline.java:261)
at org.hippoecm.hst.core.container.TestHstSitePipeline.testPageCacheContext(TestHstSitePipeline.java:274)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
...