use of com.cloud.agent.api.NetworkRulesSystemVmCommand in project cloudstack by apache.
the class NotAValidCommand method testNetworkRulesSystemVmCommandNonUserFalse.
@Test
public void testNetworkRulesSystemVmCommandNonUserFalse() {
final Connection conn = Mockito.mock(Connection.class);
final NetworkRulesSystemVmCommand netRules = new NetworkRulesSystemVmCommand("Test", VirtualMachine.Type.DomainRouter);
final CitrixRequestWrapper wrapper = CitrixRequestWrapper.getInstance();
assertNotNull(wrapper);
when(citrixResourceBase.getConnection()).thenReturn(conn);
when(citrixResourceBase.callHostPlugin(conn, "vmops", "default_network_rules_systemvm", "vmName", netRules.getVmName())).thenReturn("false");
final Answer answer = wrapper.execute(netRules, citrixResourceBase);
verify(citrixResourceBase, times(1)).getConnection();
assertFalse(answer.getResult());
}
Aggregations