We are trying to build a Rest Service layer above existing code base.
In many scenarios the constructor is populating the class variables through getting the current page url parameters. But when we are trying to call those controller from our service class we are not able to set the current page reference so that the controller can pick up parameter (i.e. url?param1=abc¶m2=xyz) values for given page reference.
Is there any way to achieve the similar scenario where we set currentPageReference in test classes, but it is not possible to use above method as it is a non-test scenario.
Any help would be much appreciated.