mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
engine-schema,test: fix domain searchbuilder, test check (#8725)
The SearchBuilder listDomainAndTypeAndNoTagSearch in ReservationDaoImpl.java is wrongly created by adding ACCOUNT_ID as part of the search param. Instead it should be DOMAIN_ID. Additional fixes in test cases to: - add assert - add spacing
This commit is contained in:
parent
6f27b1f459
commit
68a3e9e839
@ -1131,7 +1131,7 @@ public class VirtualMachineManagerImplTest {
|
||||
poolListMock.add(storagePoolVoMock);
|
||||
Mockito.doReturn(poolListMock).when(storagePoolAllocatorMock).allocateToPool(any(DiskProfile.class), any(VirtualMachineProfile.class), any(DeploymentPlan.class),
|
||||
any(ExcludeList.class), Mockito.eq(1));
|
||||
boolean result = virtualMachineManagerImpl.isDiskOfferingSuitableForVm(vmInstanceMock, virtualMachineProfileMock, 1L, 1L,1L, 1L);
|
||||
boolean result = virtualMachineManagerImpl.isDiskOfferingSuitableForVm(vmInstanceMock, virtualMachineProfileMock, 1L, 1L, 1L, 1L);
|
||||
assertTrue(result);
|
||||
}
|
||||
|
||||
@ -1140,7 +1140,7 @@ public class VirtualMachineManagerImplTest {
|
||||
Mockito.doReturn(Mockito.mock(DiskOfferingVO.class)).when(diskOfferingDaoMock).findById(anyLong());
|
||||
Mockito.doReturn(new ArrayList<>()).when(storagePoolAllocatorMock).allocateToPool(any(DiskProfile.class), any(VirtualMachineProfile.class), any(DeploymentPlan.class),
|
||||
any(ExcludeList.class), Mockito.eq(1));
|
||||
boolean result = virtualMachineManagerImpl.isDiskOfferingSuitableForVm(vmInstanceMock, virtualMachineProfileMock, 1L, 1L,1L, 1L);
|
||||
boolean result = virtualMachineManagerImpl.isDiskOfferingSuitableForVm(vmInstanceMock, virtualMachineProfileMock, 1L, 1L, 1L, 1L);
|
||||
assertFalse(result);
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ public class ReservationDaoImpl extends GenericDaoBase<ReservationVO, Long> impl
|
||||
listDomainAndTypeSearch.done();
|
||||
|
||||
listDomainAndTypeAndNoTagSearch = createSearchBuilder();
|
||||
listDomainAndTypeAndNoTagSearch.and(ACCOUNT_ID, listDomainAndTypeAndNoTagSearch.entity().getAccountId(), SearchCriteria.Op.EQ);
|
||||
listDomainAndTypeAndNoTagSearch.and(DOMAIN_ID, listDomainAndTypeAndNoTagSearch.entity().getDomainId(), SearchCriteria.Op.EQ);
|
||||
listDomainAndTypeAndNoTagSearch.and(RESOURCE_TYPE, listDomainAndTypeAndNoTagSearch.entity().getResourceType(), SearchCriteria.Op.EQ);
|
||||
listDomainAndTypeAndNoTagSearch.and(RESOURCE_TAG, listDomainAndTypeAndNoTagSearch.entity().getTag(), SearchCriteria.Op.NULL);
|
||||
listDomainAndTypeAndNoTagSearch.done();
|
||||
|
||||
@ -348,7 +348,7 @@ public class QueryManagerImplTest {
|
||||
|
||||
@Test
|
||||
public void testGetHostTagsFromTemplateForServiceOfferingsListingNoTemplateId() {
|
||||
CollectionUtils.isEmpty(queryManager.getHostTagsFromTemplateForServiceOfferingsListing(Mockito.mock(AccountVO.class), null));
|
||||
Assert.assertTrue(CollectionUtils.isEmpty(queryManager.getHostTagsFromTemplateForServiceOfferingsListing(Mockito.mock(AccountVO.class), null)));
|
||||
}
|
||||
|
||||
@Test(expected = InvalidParameterValueException.class)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user