test_class.declarator: niciraResource = mock(NiciraNvpResource.class)
test_class.modifier: private final
test_class.original_string: private final NiciraNvpResource niciraResource = mock(NiciraNvpResource.class);
test_class.type: NiciraNvpResource
test_class.var_name: niciraResource
test_class.declarator: niciraApi = mock(NiciraNvpApi.class)
test_class.modifier: private final
test_class.original_string: private final NiciraNvpApi niciraApi = mock(NiciraNvpApi.class);
test_class.type: NiciraNvpApi
test_class.var_name: niciraApi
test_class.file: plugins/network-elements/nicira-nvp/src/test/java/com/cloud/network/resource/wrapper/NiciraCheckHealthCommandWrapperTest.java
test_class.identifier: NiciraCheckHealthCommandWrapperTest
test_case.body: @Test
      public void tetsExecuteWhenClusterIsNotStable() throws Exception {
          when(niciraApi.getControlClusterStatus()).thenReturn(new ControlClusterStatus());
  
          final NiciraCheckHealthCommandWrapper commandWrapper = new NiciraCheckHealthCommandWrapper();
          final Answer answer = commandWrapper.execute(new CheckHealthCommand(), niciraResource);
  
          assertThat(answer.getResult(), equalTo(false));
      }
test_case.class_method_signature: NiciraCheckHealthCommandWrapperTest.tetsExecuteWhenClusterIsNotStable()
test_case.full_signature: @Test public void tetsExecuteWhenClusterIsNotStable()
test_case.identifier: tetsExecuteWhenClusterIsNotStable
test_case.invocations: thenReturn when getControlClusterStatus execute assertThat getResult equalTo
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void tetsExecuteWhenClusterIsNotStable()
focal_class.declarator: CONTROL_CLUSTER_STATUS_IS_STABLE = "stable"
focal_class.modifier: private static final
focal_class.original_string: private static final String CONTROL_CLUSTER_STATUS_IS_STABLE = "stable";
focal_class.type: String
focal_class.var_name: CONTROL_CLUSTER_STATUS_IS_STABLE
focal_class.declarator: s_logger = LoggerFactory.getLogger(NiciraCheckHealthCommandWrapper.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger s_logger = LoggerFactory.getLogger(NiciraCheckHealthCommandWrapper.class);
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.file: plugins/network-elements/nicira-nvp/src/main/java/com/cloud/network/resource/wrapper/NiciraCheckHealthCommandWrapper.java
focal_class.identifier: NiciraCheckHealthCommandWrapper
focal_class.class_method_signature: NiciraCheckHealthCommandWrapper.execute(final CheckHealthCommand command, final NiciraNvpResource serverResource)
focal_class.full_signature: @Override public Answer execute(final CheckHealthCommand command, final NiciraNvpResource serverResource)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (final CheckHealthCommand command, final NiciraNvpResource serverResource)
focal_class.return: Answer
focal_class.signature: Answer execute(final CheckHealthCommand command, final NiciraNvpResource serverResource)
focal_class.class_method_signature: NiciraCheckHealthCommandWrapper.clusterIsUnstable(final String clusterStatus)
focal_class.full_signature: protected boolean clusterIsUnstable(final String clusterStatus)
focal_class.identifier: clusterIsUnstable
focal_class.modifiers: protected
focal_class.parameters: (final String clusterStatus)
focal_class.return: boolean
focal_class.signature: boolean clusterIsUnstable(final String clusterStatus)
focal_class.superclass: extends CommandWrapper<CheckHealthCommand, Answer, NiciraNvpResource>
focal_method.body: @Override
      public Answer execute(final CheckHealthCommand command, final NiciraNvpResource serverResource) {
          final NiciraNvpApi niciraNvpApi = serverResource.getNiciraNvpApi();
          boolean healthy = true;
          try {
              final ControlClusterStatus clusterStatus = niciraNvpApi.getControlClusterStatus();
              final String status = clusterStatus.getClusterStatus();
              if (clusterIsUnstable(status)) {
                  s_logger.warn("Control cluster is not stable. Current status is " + status);
                  healthy = false;
              }
          } catch (final NiciraNvpApiException e) {
              s_logger.error("Exception caught while checking control cluster status during health check", e);
              healthy = false;
          }
  
          return new CheckHealthAnswer(command, healthy);
      }
focal_method.class_method_signature: NiciraCheckHealthCommandWrapper.execute(final CheckHealthCommand command, final NiciraNvpResource serverResource)
focal_method.full_signature: @Override public Answer execute(final CheckHealthCommand command, final NiciraNvpResource serverResource)
focal_method.identifier: execute
focal_method.invocations: getNiciraNvpApi getControlClusterStatus getClusterStatus clusterIsUnstable warn error
focal_method.modifiers: @Override public
focal_method.parameters: (final CheckHealthCommand command, final NiciraNvpResource serverResource)
focal_method.return: Answer
focal_method.signature: Answer execute(final CheckHealthCommand command, final NiciraNvpResource serverResource)