Search in sources :

Example 6 with CheckHealthCommand

use of com.cloud.legacymodel.communication.command.CheckHealthCommand in project cosmic by MissionCriticalCloud.

the class NiciraCheckHealthCommandWrapperTest method tetsExecuteWhenApiThrowsException.

@Test
public void tetsExecuteWhenApiThrowsException() throws Exception {
    when(niciraApi.getControlClusterStatus()).thenThrow(NiciraNvpApiException.class);
    final NiciraCheckHealthCommandWrapper commandWrapper = new NiciraCheckHealthCommandWrapper();
    final Answer answer = commandWrapper.execute(new CheckHealthCommand(), niciraResource);
    assertThat(answer.getResult(), equalTo(false));
}
Also used : Answer(com.cloud.legacymodel.communication.answer.Answer) CheckHealthCommand(com.cloud.legacymodel.communication.command.CheckHealthCommand) Test(org.junit.Test)

Aggregations

Answer (com.cloud.legacymodel.communication.answer.Answer)6 CheckHealthCommand (com.cloud.legacymodel.communication.command.CheckHealthCommand)6 Test (org.junit.Test)5 AttachAnswer (com.cloud.legacymodel.communication.answer.AttachAnswer)2 ControlClusterStatus (com.cloud.network.nicira.ControlClusterStatus)2 LibvirtRequestWrapper (com.cloud.agent.resource.kvm.wrapper.LibvirtRequestWrapper)1 HostVO (com.cloud.host.HostVO)1 AgentControlAnswer (com.cloud.legacymodel.communication.answer.AgentControlAnswer)1 CheckRouterAnswer (com.cloud.legacymodel.communication.answer.CheckRouterAnswer)1 CreateAnswer (com.cloud.legacymodel.communication.answer.CreateAnswer)1 PingAnswer (com.cloud.legacymodel.communication.answer.PingAnswer)1 ReadyAnswer (com.cloud.legacymodel.communication.answer.ReadyAnswer)1 RebootAnswer (com.cloud.legacymodel.communication.answer.RebootAnswer)1 StartupAnswer (com.cloud.legacymodel.communication.answer.StartupAnswer)1 UnsupportedAnswer (com.cloud.legacymodel.communication.answer.UnsupportedAnswer)1 HostStatus (com.cloud.legacymodel.dc.HostStatus)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1