new-integration-tests/src/test/java/oracle/weblogic/kubernetes/assertions/impl/WitAssertion.java
public static boolean doesImageExist(String imageName, String imageTag) {
    getLogger().info("Checking if image " + imageName + ":" + imageTag + " exists.");
    // verify the docker image is created
    Exception exception = null;;
    try {
      ExecResult result = ExecCommand.exec(
          "docker images -q " 
          + imageName
          + ":"
          + imageTag
          + "| wc -l");
          
      if (Integer.parseInt(result.stdout().trim()) != 1) {
        return false;
      }
    } catch (Exception e) {
      exception = e;
    }
    assertThat(exception)
          .as("Check if th expected Docker image exists")
          .withFailMessage("Failed to check if Docker image " 
              + imageName 
              + ":" 
              + imageTag
              + "exists.")
          .isNull();
    return true;
  }
/**
   * Check if a Docker image exists.
   * @param imageName - the name of the image to be checked
   * @param imageTag  - the tag of the image to be checked
   * @return true if the image does exist, false otherwise
   */
Check if a Docker image exists.
@param imageName - the name of the image to be checked
@param imageTag  - the tag of the image to be checked
@return true if the image does exist, false otherwise
Check if a Docker image exists . @param imageName - the name of the image to be checked @param imageTag - the tag of the image to be checked @return true if the image does exist false otherwise
public static boolean doesImageExist(String imageName, String imageTag) {
    getLogger().info("Checking if image " + imageName + ":" + imageTag + " exists.");
    Exception exception = null;;
    try {
      ExecResult result = ExecCommand.exec(
          "docker images -q " 
          + imageName
          + ":"
          + imageTag
          + "| wc -l");
      if (Integer.parseInt(result.stdout().trim()) != 1) {
        return false;
      }
    } catch (Exception e) {
      exception = e;
    }
    assertThat(exception)
          .as("Check if th expected Docker image exists")
          .withFailMessage("Failed to check if Docker image " 
              + imageName 
              + ":" 
              + imageTag
              + "exists.")
          .isNull();
    return true;
  }
public static boolean doesImageExist ( String imageName , String imageTag ) { getLogger ( ) . info ( "Checking if image " + imageName + ":" + imageTag + " exists." ) ; Exception exception = null ; ; try { ExecResult result = ExecCommand . exec ( "docker images -q " + imageName + ":" + imageTag + "| wc -l" ) ; if ( Integer . parseInt ( result . stdout ( ) . trim ( ) ) != 1 ) { return false ; } } catch ( Exception e ) { exception = e ; } assertThat ( exception ) . as ( "Check if th expected Docker image exists" ) . withFailMessage ( "Failed to check if Docker image " + imageName + ":" + imageTag + "exists." ) . isNull ( ) ; return true ; }
Check if a Docker image exists.
Check if a Docker image exists .
// verify the docker image is created