integration-tests/src/test/java/oracle/kubernetes/operator/utils/Operator.java
public void verifyExternalRestService() throws Exception {
    if (externalRestEnabled) {
      LoggerHelper.getLocal().log(Level.INFO, "Checking REST service is running");
      String restCmd =
          "kubectl get services -n "
              + operatorNS
              + " -o jsonpath='{.items[?(@.metadata.name == \"external-weblogic-operator-svc\")]}'";
      LoggerHelper.getLocal().log(Level.INFO, "Cmd to check REST service " + restCmd);
      ExecResult result = ExecCommand.exec(restCmd);
      if (result.exitValue() != 0) {
        throw new RuntimeException(
            "FAILURE: command " + restCmd + " failed, returned " + result.stderr());
      }
      String restService = result.stdout().trim();
      LoggerHelper.getLocal().log(Level.INFO, "cmd result for REST service " + restService);
      if (!restService.contains("name:external-weblogic-operator-svc")) {
        throw new RuntimeException("FAILURE: operator rest service was not created");
      }
    } else {
      LoggerHelper.getLocal().log(Level.INFO, "External REST service is not enabled");
    }
  }
/**
   * Verify external REST service is running.
   *
   * @throws Exception exception
   */
Verify external REST service is running.
@throws Exception exception
Verify external REST service is running . @throws Exception exception
public void verifyExternalRestService() throws Exception {
    if (externalRestEnabled) {
      LoggerHelper.getLocal().log(Level.INFO, "Checking REST service is running");
      String restCmd =
          "kubectl get services -n "
              + operatorNS
              + " -o jsonpath='{.items[?(@.metadata.name == \"external-weblogic-operator-svc\")]}'";
      LoggerHelper.getLocal().log(Level.INFO, "Cmd to check REST service " + restCmd);
      ExecResult result = ExecCommand.exec(restCmd);
      if (result.exitValue() != 0) {
        throw new RuntimeException(
            "FAILURE: command " + restCmd + " failed, returned " + result.stderr());
      }
      String restService = result.stdout().trim();
      LoggerHelper.getLocal().log(Level.INFO, "cmd result for REST service " + restService);
      if (!restService.contains("name:external-weblogic-operator-svc")) {
        throw new RuntimeException("FAILURE: operator rest service was not created");
      }
    } else {
      LoggerHelper.getLocal().log(Level.INFO, "External REST service is not enabled");
    }
  }
public void verifyExternalRestService ( ) throws Exception { if ( externalRestEnabled ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Checking REST service is running" ) ; String restCmd = "kubectl get services -n " + operatorNS + " -o jsonpath='{.items[?(@.metadata.name == \"external-weblogic-operator-svc\")]}'" ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Cmd to check REST service " + restCmd ) ; ExecResult result = ExecCommand . exec ( restCmd ) ; if ( result . exitValue ( ) != 0 ) { throw new RuntimeException ( "FAILURE: command " + restCmd + " failed, returned " + result . stderr ( ) ) ; } String restService = result . stdout ( ) . trim ( ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "cmd result for REST service " + restService ) ; if ( ! restService . contains ( "name:external-weblogic-operator-svc" ) ) { throw new RuntimeException ( "FAILURE: operator rest service was not created" ) ; } } else { LoggerHelper . getLocal ( ) . log ( Level . INFO , "External REST service is not enabled" ) ; } }
Verify external REST service is running.
Verify external REST service is running .