Change in ovirt-engine[master]: restapi: VmMapper test - Move mock to class level

oliel at redhat.com oliel at redhat.com
Wed Oct 2 10:07:15 UTC 2013


Ori Liel has submitted this change and it was merged.

Change subject: restapi: VmMapper test - Move mock to class level
......................................................................


restapi: VmMapper test - Move mock to class level

When mapping OsType, the code references a service which is currently mocked.
But it's not mocked everywhere it should be, and the result is a strange
behavior: when all the test method in VmMapperTest are run sequentially,
one after the other - they pass. But if only 'testRoundTrip()' is run - it
fails.

The current change takes the necessary mocking up to the class level. The mocking
is static and should only happen once - that's why the class level is the
right place. And this way all test methods benefit from the mocking.

Change-Id: Iaa9794a268551461263ff0aecb12a12cda279bd1
Signed-off-by: Ori Liel <oliel at redhat.com>
---
M backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
1 file changed, 6 insertions(+), 4 deletions(-)

Approvals:
  Ori Liel: Verified; Looks good to me, approved



-- 
To view, visit http://gerrit.ovirt.org/19777
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa9794a268551461263ff0aecb12a12cda279bd1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ori Liel <oliel at redhat.com>
Gerrit-Reviewer: Ori Liel <oliel at redhat.com>



More information about the Engine-commits mailing list