use of com.cloud.agent.api.OvsSetupBridgeCommand in project cloudstack by apache.
the class NotAValidCommand method testOvsSetupBridgeCommand.
@Test
public void testOvsSetupBridgeCommand() {
final Connection conn = Mockito.mock(Connection.class);
final OvsSetupBridgeCommand setupBridge = new OvsSetupBridgeCommand("Test", 1l, 1l);
final CitrixRequestWrapper wrapper = CitrixRequestWrapper.getInstance();
assertNotNull(wrapper);
when(citrixResourceBase.getConnection()).thenReturn(conn);
final Answer answer = wrapper.execute(setupBridge, citrixResourceBase);
verify(citrixResourceBase, times(1)).getConnection();
verify(citrixResourceBase, times(1)).findOrCreateTunnelNetwork(conn, setupBridge.getBridgeName());
verify(citrixResourceBase, times(1)).configureTunnelNetwork(conn, setupBridge.getNetworkId(), setupBridge.getHostId(), setupBridge.getBridgeName());
assertTrue(answer.getResult());
}
Aggregations