From Allon Mureinik <amureini(a)redhat.com>:
Allon Mureinik has submitted this change and it was merged.
Change subject: core: Default ValidationResult mocking for BLL
......................................................................
core: Default ValidationResult mocking for BLL
When mocking an object, it's expected that methods that have no
stubbed behavior will return "empty" results - zeroes, false, empty
collection, etc.
For ValidationResult, the "empty" value should be
ValidationResult#VALID.
This patch overrides Mockito's default behavior of returning null and
returns this value instead, thus allowing for much cleaner and leaner
tests in the BLL package.
Change-Id: I34e7bfdf1f4a2d5f01d7b67b345717506e70490b
Signed-off-by: Allon Mureinik <amureini(a)redhat.com>
---
A
backend/manager/modules/bll/src/test/java/org/mockito/configuration/MockitoConfiguration.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmFromSnapshotCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmFromTemplateCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmTemplateCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommonVmPoolCommandTestAbstract.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RunVmCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateClusterCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateVmCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/exportimport/ExternalVnicProfileMappingValidatorTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/exportimport/ImportVMFromConfigurationCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/exportimport/ImportVmTemplateCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/hostdeploy/AddVdsCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/hostdeploy/UpdateVdsCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/memory/sdfilters/StorageDomainSpaceRequirementsFilterTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/host/HostSetupNetworksValidatorTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/vm/ValidateVmMacsQueryTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/snapshots/CreateAllSnapshotsFromVmCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/snapshots/RemoveDiskSnapshotsCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/snapshots/RestoreAllSnapshotsCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/connection/AttachStorageServerConnectionToStorageDomainCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/connection/DetachStorageConnectionFromStorageDomainCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/connection/UpdateStorageServerConnectionExtensionCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/disk/AddDiskCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/disk/AttachDiskToVmCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/disk/HotPlugDiskToVmCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/disk/MoveOrCopyDiskCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/disk/UpdateVmDiskCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/disk/image/TransferDiskImageCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/domain/ExtendSANStorageDomainCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/domain/UpdateStorageDomainCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/lsm/LiveMigrateVmDisksCommandTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/ImportValidatorTest.java
M
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/storage/MultipleStorageDomainsValidatorTest.java
34 files changed, 30 insertions(+), 305 deletions(-)
Approvals:
Allon Mureinik: Verified; Looks good to me, approved; Passed CI tests
--
To view, visit
https://gerrit.ovirt.org/74211
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I34e7bfdf1f4a2d5f01d7b67b345717506e70490b
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Betak <mbetak(a)redhat.com>
Gerrit-Reviewer: Martin Mucha <mmucha(a)redhat.com>
Gerrit-Reviewer: Martin Peřina <mperina(a)redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag(a)redhat.com>
Gerrit-Reviewer: Roman Mohr <rmohr(a)redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan(a)redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan(a)redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzaspits(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>