Azure / Azure/azure-functions-java-library

Provide access to settings through context parameter

未关闭
#89 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:java-functions new-feature P2
主要语言
Java
星标
45
派生
49
PR 合并指标
30 天内没有已合并 PR

描述

I created the following issue on the java worker repo, but this repo seems to be a better fit. https://github.com/Azure/azure-functions-java-worker/issues/281

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.

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先定位 Java 上下文参数 API 以及 issue 中描述的现有环境变量访问路径。跟踪 host 在运行时如何提供上下文,然后确定所需的单元测试覆盖范围,以验证 mocked context 可以提供一个设置,而运行时访问仍然读取环境变量。

由索引模型根据 Issue 内容生成。

评估

技术栈
azure, java
领域
backend, cloud
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。