azure-functions-java-worker
azure-functions-java-worker copied to clipboard
Provide access to settings through context parameter
Currently it is hard to unit test a function that uses an app setting by reading it from the environment variables. It would be much easier if there was a getSetting(settingName) method on the context parameter, as the context parameter can be mocked in unit tests. At runtime the host can continue to read the value from an environment variable via the method in the context parameter, so there wouldn't be any breaking changes to the runtime.
Created a new issue on the java-library repo: https://github.com/Azure/azure-functions-java-library/issues/89
Reopening this issue. After digging into the code to do a pull request, I got stuck on the fact that the change is spit across both repositories. The library repo has the interface which needs to be updated. This repo has the implementation of that interface, and would need to be updated alongside it.