Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public interface HostDao extends GenericDao<HostVO, Long>, StateDao<Status, Stat
List<String> listOrderedHostsHypervisorVersionsInDatacenter(long datacenterId, HypervisorType hypervisorType);

List<HostVO> findHostsWithTagRuleThatMatchComputeOferringTags(String computeOfferingTags);
List<HostVO> findHostsWithTagRuleThatMatchComputeOferringTags(String computeOfferingTags, Long clusterId, Long podId, Long dcId);

List<Long> findClustersThatMatchHostTagRule(String computeOfferingTags);

Expand Down
15 changes: 15 additions & 0 deletions engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,7 @@ private List<Long> findHostIdsByHostTags(String hostTags){
}
}

@Override
public List<HostVO> findHostsWithTagRuleThatMatchComputeOferringTags(String computeOfferingTags) {
List<HostTagVO> hostTagVOList = _hostTagsDao.findHostRuleTags();
List<HostVO> result = new ArrayList<>();
Expand All @@ -1468,6 +1469,20 @@ public List<HostVO> findHostsWithTagRuleThatMatchComputeOferringTags(String comp
return result;
}

@Override
public List<HostVO> findHostsWithTagRuleThatMatchComputeOferringTags(String computeOfferingTags, Long clusterId, Long podId, Long dcId) {
List<HostVO> hosts = findHostsWithTagRuleThatMatchComputeOferringTags(computeOfferingTags);
if (dcId == null && podId == null && clusterId == null) {
return hosts;
}

return hosts.stream()
.filter(host -> host != null && (dcId == null || host.getDataCenterId() == dcId))
.filter(host -> podId == null || Objects.equals(host.getPodId(), podId))
.filter(host -> clusterId == null || Objects.equals(host.getClusterId(), clusterId))
.collect(Collectors.toList());
}

public List<Long> findClustersThatMatchHostTagRule(String computeOfferingTags) {
Set<Long> result = new HashSet<>();
List<HostVO> hosts = findHostsWithTagRuleThatMatchComputeOferringTags(computeOfferingTags);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private List<Host> findSuitableHosts(VirtualMachineProfile vmProfile, Deployment
hostsCopy = _hostDao.listAllHostsThatHaveNoRuleTag(type, clusterId, podId, dcId);
}
}
hostsCopy = ListUtils.union(hostsCopy, _hostDao.findHostsWithTagRuleThatMatchComputeOferringTags(offeringHostTag));
hostsCopy = ListUtils.union(hostsCopy, _hostDao.findHostsWithTagRuleThatMatchComputeOferringTags(offeringHostTag, clusterId, podId, dcId));

if (hostsCopy.isEmpty()) {
logger.info("No suitable host found for VM [{}] in {}.", vmProfile, hostTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,24 @@
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;

import com.cloud.deploy.DeploymentPlan;
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
import com.cloud.host.Host;
import com.cloud.host.HostVO;
import com.cloud.host.dao.HostDao;
import com.cloud.capacity.CapacityManager;
import com.cloud.offering.ServiceOffering;
import com.cloud.storage.VMTemplateVO;
import com.cloud.utils.Pair;
import com.cloud.vm.VirtualMachineProfile;

@RunWith(MockitoJUnitRunner.class)
public class RandomAllocatorTest {

@Mock
HostDao hostDao;
@Mock
CapacityManager capacityManager;
@InjectMocks
RandomAllocator randomAllocator;

Expand Down Expand Up @@ -77,4 +86,37 @@
Assert.assertFalse(CollectionUtils.isEmpty(result));
Assert.assertEquals(1, result.size());
}

@Test
public void testAllocateToUsesScopedRuleTagLookup() {
Host.Type type = Host.Type.Routing;
long dcId = 1L;
Long podId = 2L;
Long clusterId = 3L;
String offeringTag = "compute";

DeploymentPlan plan = Mockito.mock(DeploymentPlan.class);

Check warning on line 98 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "mock".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EH0&open=AaAq8vl2hKBcFfom5EH0&pullRequest=13951
Mockito.when(plan.getDataCenterId()).thenReturn(dcId);

Check warning on line 99 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EH1&open=AaAq8vl2hKBcFfom5EH1&pullRequest=13951
Mockito.when(plan.getPodId()).thenReturn(podId);

Check warning on line 100 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EH2&open=AaAq8vl2hKBcFfom5EH2&pullRequest=13951
Mockito.when(plan.getClusterId()).thenReturn(clusterId);

VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);

Check warning on line 103 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "mock".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EH3&open=AaAq8vl2hKBcFfom5EH3&pullRequest=13951
ServiceOffering offering = Mockito.mock(ServiceOffering.class);

Check warning on line 104 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "mock".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EH4&open=AaAq8vl2hKBcFfom5EH4&pullRequest=13951
VMTemplateVO template = Mockito.mock(VMTemplateVO.class);

Check warning on line 105 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "mock".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EH5&open=AaAq8vl2hKBcFfom5EH5&pullRequest=13951
Mockito.when(vmProfile.getServiceOffering()).thenReturn(offering);

Check warning on line 106 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EH6&open=AaAq8vl2hKBcFfom5EH6&pullRequest=13951
Mockito.when(vmProfile.getTemplate()).thenReturn(template);

Check warning on line 107 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EH7&open=AaAq8vl2hKBcFfom5EH7&pullRequest=13951
Mockito.when(offering.getHostTag()).thenReturn(offeringTag);

HostVO host = Mockito.mock(HostVO.class);

Check warning on line 110 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "mock".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EH8&open=AaAq8vl2hKBcFfom5EH8&pullRequest=13951
List<Host> hosts = List.of(host);
Mockito.when(hostDao.listByHostTag(type, clusterId, podId, dcId, offeringTag)).thenReturn(List.of(host));

Check warning on line 112 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EH9&open=AaAq8vl2hKBcFfom5EH9&pullRequest=13951
Mockito.when(hostDao.findHostsWithTagRuleThatMatchComputeOferringTags(offeringTag, clusterId, podId, dcId)).thenReturn(new ArrayList<>());

Check warning on line 113 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EH-&open=AaAq8vl2hKBcFfom5EH-&pullRequest=13951
Mockito.when(capacityManager.checkIfHostHasCpuCapabilityAndCapacity(host, offering, true)).thenReturn(new Pair<>(true, true));

List<Host> result = randomAllocator.allocateTo(vmProfile, plan, type, new ExcludeList(), hosts, 1, true);

Assert.assertEquals(1, result.size());
Mockito.verify(hostDao).findHostsWithTagRuleThatMatchComputeOferringTags(offeringTag, clusterId, podId, dcId);

Check warning on line 119 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "verify".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EH_&open=AaAq8vl2hKBcFfom5EH_&pullRequest=13951
Mockito.verify(hostDao, Mockito.never()).findHostsWithTagRuleThatMatchComputeOferringTags(offeringTag);

Check warning on line 120 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "verify".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EIA&open=AaAq8vl2hKBcFfom5EIA&pullRequest=13951

Check warning on line 120 in plugins/host-allocators/random/src/test/java/com/cloud/agent/manager/allocator/impl/RandomAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "never".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vl2hKBcFfom5EIB&open=AaAq8vl2hKBcFfom5EIB&pullRequest=13951
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public List<Host> allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan pla
clusterHosts.retainAll(hostsMatchingUefiTag);
}

clusterHosts.addAll(_hostDao.findHostsWithTagRuleThatMatchComputeOferringTags(hostTagOnOffering));
clusterHosts.addAll(_hostDao.findHostsWithTagRuleThatMatchComputeOferringTags(hostTagOnOffering, clusterId, podId, dcId));


if (clusterHosts.isEmpty()) {
Expand Down Expand Up @@ -274,7 +274,7 @@ public List<Host> allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan pla
}
}

hostsCopy.addAll(_hostDao.findHostsWithTagRuleThatMatchComputeOferringTags(hostTagOnOffering));
hostsCopy.addAll(_hostDao.findHostsWithTagRuleThatMatchComputeOferringTags(hostTagOnOffering, clusterId, podId, dcId));

if (!hostsCopy.isEmpty()) {
suitableHosts = allocateTo(plan, offering, template, avoid, hostsCopy, returnUpTo, considerReservedCapacity, account);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.agent.manager.allocator.impl;

import java.util.ArrayList;
import java.util.List;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;

import com.cloud.deploy.DeploymentPlan;
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
import com.cloud.host.Host;
import com.cloud.host.HostVO;
import com.cloud.host.dao.HostDao;
import com.cloud.offering.ServiceOffering;
import com.cloud.storage.VMTemplateVO;
import com.cloud.user.Account;
import com.cloud.vm.VirtualMachineProfile;

@RunWith(MockitoJUnitRunner.class)
public class FirstFitAllocatorTest {

@Mock
HostDao hostDao;
@Spy
@InjectMocks
FirstFitAllocator firstFitAllocator;

@Test
public void testAllocateToWithHostsUsesScopedRuleTagLookup() {
Host.Type type = Host.Type.Routing;
long dcId = 1L;
Long podId = 2L;
Long clusterId = 3L;
String offeringTag = "compute";

DeploymentPlan plan = Mockito.mock(DeploymentPlan.class);

Check warning on line 58 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "mock".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIC&open=AaAq8vq5hKBcFfom5EIC&pullRequest=13951
Mockito.when(plan.getDataCenterId()).thenReturn(dcId);

Check warning on line 59 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EID&open=AaAq8vq5hKBcFfom5EID&pullRequest=13951
Mockito.when(plan.getPodId()).thenReturn(podId);

Check warning on line 60 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIE&open=AaAq8vq5hKBcFfom5EIE&pullRequest=13951
Mockito.when(plan.getClusterId()).thenReturn(clusterId);

Check warning on line 61 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIF&open=AaAq8vq5hKBcFfom5EIF&pullRequest=13951

VirtualMachineProfile vmProfile = Mockito.mock(VirtualMachineProfile.class);

Check warning on line 63 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "mock".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIG&open=AaAq8vq5hKBcFfom5EIG&pullRequest=13951
ServiceOffering offering = Mockito.mock(ServiceOffering.class);

Check warning on line 64 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "mock".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIH&open=AaAq8vq5hKBcFfom5EIH&pullRequest=13951
VMTemplateVO template = Mockito.mock(VMTemplateVO.class);

Check warning on line 65 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "mock".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EII&open=AaAq8vq5hKBcFfom5EII&pullRequest=13951
Account account = Mockito.mock(Account.class);

Check warning on line 66 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "mock".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIJ&open=AaAq8vq5hKBcFfom5EIJ&pullRequest=13951
Mockito.when(vmProfile.getServiceOffering()).thenReturn(offering);

Check warning on line 67 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIK&open=AaAq8vq5hKBcFfom5EIK&pullRequest=13951
Mockito.when(vmProfile.getTemplate()).thenReturn(template);

Check warning on line 68 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIL&open=AaAq8vq5hKBcFfom5EIL&pullRequest=13951
Mockito.when(vmProfile.getOwner()).thenReturn(account);

Check warning on line 69 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIM&open=AaAq8vq5hKBcFfom5EIM&pullRequest=13951
Mockito.when(offering.getHostTag()).thenReturn(offeringTag);

Check warning on line 70 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIN&open=AaAq8vq5hKBcFfom5EIN&pullRequest=13951

HostVO host = Mockito.mock(HostVO.class);

Check warning on line 72 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "mock".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIO&open=AaAq8vq5hKBcFfom5EIO&pullRequest=13951
List<Host> selectedHosts = List.of(host);
Mockito.when(hostDao.listByHostTag(type, clusterId, podId, dcId, offeringTag)).thenReturn(List.of(host));

Check warning on line 74 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIP&open=AaAq8vq5hKBcFfom5EIP&pullRequest=13951
Mockito.when(hostDao.findHostsWithTagRuleThatMatchComputeOferringTags(offeringTag, clusterId, podId, dcId)).thenReturn(new ArrayList<>());

Check warning on line 75 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "when".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIQ&open=AaAq8vq5hKBcFfom5EIQ&pullRequest=13951
Mockito.doReturn(selectedHosts).when(firstFitAllocator).allocateTo(

Check warning on line 76 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "doReturn".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIR&open=AaAq8vq5hKBcFfom5EIR&pullRequest=13951
Mockito.eq(plan), Mockito.eq(offering), Mockito.eq(template), Mockito.any(ExcludeList.class), Mockito.anyList(), Mockito.eq(1), Mockito.eq(true), Mockito.eq(account));

List<Host> result = firstFitAllocator.allocateTo(vmProfile, plan, type, new ExcludeList(), selectedHosts, 1, true);

Assert.assertEquals(1, result.size());
Mockito.verify(hostDao).findHostsWithTagRuleThatMatchComputeOferringTags(offeringTag, clusterId, podId, dcId);

Check warning on line 82 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "verify".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIS&open=AaAq8vq5hKBcFfom5EIS&pullRequest=13951
Mockito.verify(hostDao, Mockito.never()).findHostsWithTagRuleThatMatchComputeOferringTags(offeringTag);

Check warning on line 83 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "never".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIU&open=AaAq8vq5hKBcFfom5EIU&pullRequest=13951

Check warning on line 83 in server/src/test/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocatorTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use a static import for "verify".

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AaAq8vq5hKBcFfom5EIT&open=AaAq8vq5hKBcFfom5EIT&pullRequest=13951
}
}
Loading