Change in ovirt-engine[master]: engine: Don't stub default collections

Code Review gerrit at ovirt.org
Sun Mar 19 08:53:24 UTC 2017


>From Allon Mureinik <amureini at redhat.com>:

Allon Mureinik has submitted this change and it was merged.

Change subject: engine: Don't stub default collections
......................................................................


engine: Don't stub default collections

By default, Mockito returns empty collections from mock objects.
Explicitly stubbing that behavior needlessly complicates the test,
and makes it harder to maintain.

This patch removes those redundant behavior stubbings.

Change-Id: Idfa50e3387fa5f4d139728de6bdfc8e4c718a00d
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
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/MacPoolValidatorTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/MoveMacsTest.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/VmSlaPolicyCommandTest.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/gluster/GeoRepSessionCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterGeoRepSyncJobTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterHookSyncJobTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterHostValidatorTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterTasksSyncJobTest.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/host/VfSchedulerImplTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/vm/mac/VmMacsValidationTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/pm/StartVdsCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/scheduling/commands/ClusterPolicyCRUDCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StorageHandlingCommandBaseTest.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/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/domain/ActivateStorageDomainCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/domain/AttachStorageDomainToPoolCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/domain/DeactivateStorageDomainCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/domain/GetStorageDomainsWithAttachedStoragePoolGuidQueryTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/domain/GetUnregisteredBlockStorageDomainsQueryTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/pool/UpdateStoragePoolCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/ClusterValidatorTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/NetworkAttachmentValidatorTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/RunVmValidatorTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/UpdateHostValidatorTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/storage/DiskImagesValidatorTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/storage/DiskValidatorTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/storage/DiskVmElementValidatorTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/storage/StorageDomainToPoolRelationValidatorTest.java
M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendSnapshotsResourceTest.java
M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolsResourceTest.java
M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/util/QueryHelperTest.java
M backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/ovf/HostedEngineOvfWriterTest.java
M backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/monitoring/HostMonitoringTest.java
M backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/vdsbroker/HostNetworkAttachmentsPersisterTest.java
M backend/manager/modules/welcome/src/test/java/org/ovirt/engine/core/WelcomeServletTest.java
M frontend/webadmin/modules/uicommonweb/src/test/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/ExecuteNetworkCommandInNetworkOperationTest.java
43 files changed, 6 insertions(+), 158 deletions(-)

Approvals:
  Denis Chaplygin: Looks good to me, but someone else must approve
  Tal Nisan: Looks good to me, approved
  Jenkins CI: Passed CI tests
  Allon Mureinik: Verified



-- 
To view, visit https://gerrit.ovirt.org/74210
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idfa50e3387fa5f4d139728de6bdfc8e4c718a00d
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Denis Chaplygin <dchaplyg at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Martin Peřina <mperina at redhat.com>
Gerrit-Reviewer: Sahina Bose <sabose at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list