}
@Test
public void testRemoveIpFromVmNicFailure() throws InsufficientAddressCapacityException {
NetworkService networkService = Mockito.mock(NetworkService.class);
RemoveIpFromVmNicCmd removeIpFromNic = Mockito.mock(RemoveIpFromVmNicCmd.class);
Mockito.when(
networkService.releaseSecondaryIpFromNic(Mockito.anyInt())).thenReturn(false);
removeIpFromNic._networkService = networkService;
successResponseGenerator = Mockito.mock(SuccessResponse.class);
try {
removeIpFromNic.execute();
} catch (InvalidParameterValueException exception) {
Assert.assertEquals("Failed to remove secondary ip address for the nic",
exception.getLocalizedMessage());
}
}