
[英]How to check whether HttpServletRequest contains the key in Java (Using spring boot)
[英]How to overwrite String depending on whether the map contains a key in java without using 'if'?
我将使用将在 selenium 中发送文本的方法 addPresetToTaskView。 如果地图场景上下文包含与预设值完全相同的键,则此方法应使用字符串预设值或覆盖它
我不确定这是否是最佳做法。
你能和我分享你的意见吗?
@And("Added preset by {string} text {string} for permission {string} to data view")
public void addPresetToTaskView(String option, String presetValue, String permissionName) {
if(scenarioContext.contextContainsKey(presetValue)) {
presetValue = (String) scenarioContext.getContext(presetValue);
}
setSingleSelectformItem(presetValue, visibleTabsSelect);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.