fix(接口测试): dubbo获取providers报空指针异常
--bug=1014354 --user=陈建星 [接口测试]github#13776获取dubbo列表每次去拉取provider数据太慢,并且有脏数据会导致空指针异常 https://www.tapd.cn/55049933/s/1190706
This commit is contained in:
parent
c81ab30964
commit
35a8ef33bb
|
@ -387,9 +387,14 @@ public class APITestService {
|
|||
provider.setService(p);
|
||||
provider.setServiceInterface(info[0]);
|
||||
Map<String, URL> services = providerService.findByService(p);
|
||||
if (services != null && !services.isEmpty()) {
|
||||
String[] methods = services.values().stream().findFirst().get().getParameter(CommonConstants.METHODS_KEY).split(",");
|
||||
provider.setMethods(Arrays.asList(methods));
|
||||
if (services != null && !services.isEmpty() && !CollectionUtils.isEmpty(services.values())) {
|
||||
String parameter = services.values().stream().findFirst().get().getParameter(CommonConstants.METHODS_KEY);
|
||||
if (StringUtils.isNotBlank(parameter)) {
|
||||
String[] methods = parameter.split(",");
|
||||
provider.setMethods(Arrays.asList(methods));
|
||||
} else {
|
||||
provider.setMethods(new ArrayList<>());
|
||||
}
|
||||
} else {
|
||||
provider.setMethods(new ArrayList<>());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue