mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-03 20:49:56 +08:00
refactor(接口测试): 优化local资源池被禁选择资源池的逻辑
This commit is contained in:
parent
07b9584d71
commit
efa9beee89
@ -91,11 +91,14 @@ public class ApiPoolDebugService {
|
||||
|
||||
if (!contains) {
|
||||
List<TestResourcePoolDTO> pools = poolList.stream().filter(pool ->
|
||||
StringUtils.equals(pool.getName(), "LOCAL")).collect(Collectors.toList());
|
||||
StringUtils.equals(pool.getName(), "LOCAL") &&
|
||||
!StringUtils.equals(config.getResourcePoolId(),pool.getId())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(pools)) {
|
||||
config.setResourcePoolId(pools.get(0).getId());
|
||||
} else {
|
||||
config.setResourcePoolId(poolList.get(0).getId());
|
||||
List<TestResourcePoolDTO> other = poolList.stream().filter(pool ->
|
||||
!StringUtils.equals(config.getResourcePoolId() ,pool.getId())).collect(Collectors.toList());
|
||||
config.setResourcePoolId(other.get(0).getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user