Moti Asayag has posted comments on this change.

Change subject: engine: Vnic interface validation
......................................................................


Patch Set 2: Verified-1 -Code-Review

(2 comments)

The new 3 tests fail. There is a need to mock any external resource.

It can be done by extracting the following from the validator into a getter:
  SimpleDependecyInjector.getInstance().get(OsRepository.class)

and mock it on the test.

....................................................
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/validator/VmNicValidatorTest.java
Line 58:     @Before
Line 59:     public void setup() {
Line 60:         when(version.getValue()).thenReturn(CLUSTER_VERSION);
Line 61: 
Line 62:         when(osRepository.getNetworkDevices(0, 
any(Version.class))).thenReturn(NETWORK_DEVICES);
this line should be replaced with:
 when(osRepository.getNetworkDevices(any(Integer.class), 
any(Version.class))).thenReturn(NETWORK_DEVICES);
Line 63:         when(osRepository.getNetworkDevices(0, 
null)).thenReturn(NETWORK_DEVICES);
Line 64: 
Line 65:         validator = new VmNicValidator(nic, version);
Line 66:         validatorType = new VmNicValidator(nic, version, 0);


Line 59:     public void setup() {
Line 60:         when(version.getValue()).thenReturn(CLUSTER_VERSION);
Line 61: 
Line 62:         when(osRepository.getNetworkDevices(0, 
any(Version.class))).thenReturn(NETWORK_DEVICES);
Line 63:         when(osRepository.getNetworkDevices(0, 
null)).thenReturn(NETWORK_DEVICES);
this line should be deleted.
Line 64: 
Line 65:         validator = new VmNicValidator(nic, version);
Line 66:         validatorType = new VmNicValidator(nic, version, 0);
Line 67:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia1236826adbc021f4fa7f3816c6bd8a2f199de79
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gustavo Frederico Temple Pedrosa <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Gustavo Frederico Temple Pedrosa 
<[email protected]>
Gerrit-Reviewer: Itamar Heim <[email protected]>
Gerrit-Reviewer: Leonardo Bianconi <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Vitor de Lima <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-Reviewer: ofri masad <[email protected]>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to