@SuppressWarnings("unchecked")
@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));
}