Ori Liel has posted comments on this change.

Change subject: restapi: [WIP] Add Test for adding VmPool via REST
......................................................................


Patch Set 2: (3 inline comments)

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolsResourceTest.java
Line 34:     }
Line 35: 
Line 36:     @Override
Line 37:     protected org.ovirt.engine.core.common.businessentities.VmPool 
getEntity(int index) {
Line 38:         return 
setUpEntityExpectations(control.createMock(org.ovirt.engine.core.common.businessentities.VmPool.class),
 index);
1) I think it's excessive to use mocking here, you can simply create a VmPool 
object and set values in it. 
2) In any case, there's no need to pass the mocked entity as a parameter, it 
can be initialized inside the body of setUpGetEntityExpectations()
Line 39:     }
Line 40: 
Line 41:     protected org.ovirt.engine.core.common.businessentities.VmTemplate 
getTemplateEntity(int index) {
Line 42:         return setUpEntityExpectations(


Line 39:     }
Line 40: 
Line 41:     protected org.ovirt.engine.core.common.businessentities.VmTemplate 
getTemplateEntity(int index) {
Line 42:         return setUpEntityExpectations(
Line 43:                 
control.createMock(org.ovirt.engine.core.common.businessentities.VmTemplate.class),
Same comment: 

1) I think it's excessive to use mocking here, you can simply create a 
VmTemplate object and set values in it. 
2) In any case, there's no need to pass the mocked entity as a parameter, it 
can be initialized inside the body of setUpGetEntityExpectations()
Line 44:                 index);
Line 45:     }
Line 46: 
Line 47:     private org.ovirt.engine.core.common.businessentities.VmPool 
setUpEntityExpectations(


Line 81:         return model;
Line 82:     }
Line 83: 
Line 84:     private VmPool createModel() {
Line 85: 
Why is this method necessary? I think you can remove it and use getModel(1) 
directly.
Line 86:         return getModel(0);
Line 87:     }
Line 88: 
Line 89:     @Test


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3f91f937bd6302af7f9f96fe7b3c7dfd614c2437
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <[email protected]>
Gerrit-Reviewer: Martin Betak <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ori Liel <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to