new-integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonTestUtils.java
public static boolean checkAppUsingHostHeader(String url, String hostHeader) {
    LoggingFacade logger = getLogger();
    StringBuffer curlString = new StringBuffer("status=$(curl --user weblogic:welcome1 ");
    StringBuffer headerString = null;
    if (hostHeader != null) {
      headerString = new StringBuffer("-H 'host: ");
      headerString.append(hostHeader)
                  .append(" ' ");
    } else {
      headerString = new StringBuffer("");
    }
    curlString.append(" --noproxy '*' ")
         .append(" --silent --show-error ")
         .append(headerString.toString())
         .append(url)
         .append(" -o /dev/null")
         .append(" -w %{http_code});")
         .append("echo ${status}");
    logger.info("checkAppUsingHostInfo: curl command {0}", new String(curlString));
    withQuickRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for appliation to be ready {0} "
                + "(elapsed time {1} ms, remaining time {2} ms)",
                url,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(assertDoesNotThrow(() -> {
          return () -> {
            return exec(new String(curlString), true).stdout().contains("200");
          };
        }));
    return true;
  }
/**
   * Check the application running in WebLogic server using host information in the header.
   * @param url url to access the application
   * @param hostHeader host information to be passed as http header
   * @return true if curl command returns HTTP code 200 otherwise false
  */
Check the application running in WebLogic server using host information in the header.
@param url url to access the application
@param hostHeader host information to be passed as http header
@return true if curl command returns HTTP code 200 otherwise false
Check the application running in WebLogic server using host information in the header . @param url url to access the application @param hostHeader host information to be passed as http header @return true if curl command returns HTTP code 200 otherwise false
public static boolean checkAppUsingHostHeader(String url, String hostHeader) {
    LoggingFacade logger = getLogger();
    StringBuffer curlString = new StringBuffer("status=$(curl --user weblogic:welcome1 ");
    StringBuffer headerString = null;
    if (hostHeader != null) {
      headerString = new StringBuffer("-H 'host: ");
      headerString.append(hostHeader)
                  .append(" ' ");
    } else {
      headerString = new StringBuffer("");
    }
    curlString.append(" --noproxy '*' ")
         .append(" --silent --show-error ")
         .append(headerString.toString())
         .append(url)
         .append(" -o /dev/null")
         .append(" -w %{http_code});")
         .append("echo ${status}");
    logger.info("checkAppUsingHostInfo: curl command {0}", new String(curlString));
    withQuickRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for appliation to be ready {0} "
                + "(elapsed time {1} ms, remaining time {2} ms)",
                url,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(assertDoesNotThrow(() -> {
          return () -> {
            return exec(new String(curlString), true).stdout().contains("200");
          };
        }));
    return true;
  }
public static boolean checkAppUsingHostHeader ( String url , String hostHeader ) { LoggingFacade logger = getLogger ( ) ; StringBuffer curlString = new StringBuffer ( "status=$(curl --user weblogic:welcome1 " ) ; StringBuffer headerString = null ; if ( hostHeader != null ) { headerString = new StringBuffer ( "-H 'host: " ) ; headerString . append ( hostHeader ) . append ( " ' " ) ; } else { headerString = new StringBuffer ( "" ) ; } curlString . append ( " --noproxy '*' " ) . append ( " --silent --show-error " ) . append ( headerString . toString ( ) ) . append ( url ) . append ( " -o /dev/null" ) . append ( " -w %{http_code});" ) . append ( "echo ${status}" ) ; logger . info ( "checkAppUsingHostInfo: curl command {0}" , new String ( curlString ) ) ; withQuickRetryPolicy . conditionEvaluationListener ( condition -> logger . info ( "Waiting for appliation to be ready {0} " + "(elapsed time {1} ms, remaining time {2} ms)" , url , condition . getElapsedTimeInMS ( ) , condition . getRemainingTimeInMS ( ) ) ) . until ( assertDoesNotThrow ( ( ) -> { return ( ) -> { return exec ( new String ( curlString ) , true ) . stdout ( ) . contains ( "200" ) ; } ; } ) ) ; return true ; }
Check the application running in WebLogic server using host information in the header.
Check the application running in WebLogic server using host information in the header .