new-integration-tests/src/test/java/oracle/weblogic/kubernetes/assertions/impl/Domain.java
public static boolean podStateNotChanged(String podName,
                                           String domainUid,
                                           String domainNamespace,
                                           DateTime podOriginalCreationTimestamp) {

    // if pod does not exist, return false
    if (assertDoesNotThrow(() -> doesPodNotExist(domainNamespace, domainUid, podName),
        String.format("podExists failed with ApiException for pod %s in namespace %s",
            podName, domainNamespace))) {
      getLogger().info("pod {0} does not exist in namespace {1}", podName, domainNamespace);
      return false;
    }

    // if the pod is not in ready state, return false
    getLogger().info("Checking that pod {0} is ready in namespace {1}", podName, domainNamespace);
    if (!assertDoesNotThrow(() -> isPodReady(domainNamespace, domainUid, podName),
        String.format("isPodReady failed with ApiException for pod %s in namespace %s", podName, domainNamespace))) {
      getLogger().info("pod {0} is not ready in namespace {1}", podName, domainNamespace);
      return false;
    }

    // if the pod was restarted, return false
    getLogger().info("Checking that pod {0} is not restarted in namespace {1}", podName, domainNamespace);
    if (assertDoesNotThrow(() ->
        isPodRestarted(podName, domainNamespace, podOriginalCreationTimestamp),
        String.format("isPodRestarted failed with ApiException for pod %s in namespace %s",
            podName, domainNamespace))) {
      getLogger().info("pod {0} is restarted in namespace {1}", podName, domainNamespace);
      return false;
    }

    return true;
  }
/**
   * Verify the pod state is not changed.
   * @param podName the name of the pod to check
   * @param domainUid the label the pod is decorated with
   * @param domainNamespace the domain namespace in which the pod exists
   * @param podOriginalCreationTimestamp the pod original creation timestamp
   * @return true if the pod state is not changed, false otherwise
   */
Verify the pod state is not changed.
Verify the pod state is not changed .
public static boolean podStateNotChanged(String podName,
                                           String domainUid,
                                           String domainNamespace,
                                           DateTime podOriginalCreationTimestamp) {
    if (assertDoesNotThrow(() -> doesPodNotExist(domainNamespace, domainUid, podName),
        String.format("podExists failed with ApiException for pod %s in namespace %s",
            podName, domainNamespace))) {
      getLogger().info("pod {0} does not exist in namespace {1}", podName, domainNamespace);
      return false;
    }
    getLogger().info("Checking that pod {0} is ready in namespace {1}", podName, domainNamespace);
    if (!assertDoesNotThrow(() -> isPodReady(domainNamespace, domainUid, podName),
        String.format("isPodReady failed with ApiException for pod %s in namespace %s", podName, domainNamespace))) {
      getLogger().info("pod {0} is not ready in namespace {1}", podName, domainNamespace);
      return false;
    }
    getLogger().info("Checking that pod {0} is not restarted in namespace {1}", podName, domainNamespace);
    if (assertDoesNotThrow(() ->
        isPodRestarted(podName, domainNamespace, podOriginalCreationTimestamp),
        String.format("isPodRestarted failed with ApiException for pod %s in namespace %s",
            podName, domainNamespace))) {
      getLogger().info("pod {0} is restarted in namespace {1}", podName, domainNamespace);
      return false;
    }
    return true;
  }
public static boolean podStateNotChanged ( String podName , String domainUid , String domainNamespace , DateTime podOriginalCreationTimestamp ) { if ( assertDoesNotThrow ( ( ) -> doesPodNotExist ( domainNamespace , domainUid , podName ) , String . format ( "podExists failed with ApiException for pod %s in namespace %s" , podName , domainNamespace ) ) ) { getLogger ( ) . info ( "pod {0} does not exist in namespace {1}" , podName , domainNamespace ) ; return false ; } getLogger ( ) . info ( "Checking that pod {0} is ready in namespace {1}" , podName , domainNamespace ) ; if ( ! assertDoesNotThrow ( ( ) -> isPodReady ( domainNamespace , domainUid , podName ) , String . format ( "isPodReady failed with ApiException for pod %s in namespace %s" , podName , domainNamespace ) ) ) { getLogger ( ) . info ( "pod {0} is not ready in namespace {1}" , podName , domainNamespace ) ; return false ; } getLogger ( ) . info ( "Checking that pod {0} is not restarted in namespace {1}" , podName , domainNamespace ) ; if ( assertDoesNotThrow ( ( ) -> isPodRestarted ( podName , domainNamespace , podOriginalCreationTimestamp ) , String . format ( "isPodRestarted failed with ApiException for pod %s in namespace %s" , podName , domainNamespace ) ) ) { getLogger ( ) . info ( "pod {0} is restarted in namespace {1}" , podName , domainNamespace ) ; return false ; } return true ; }
Verify the pod state is not changed.
Verify the pod state is not changed .
// if pod does not exist, return false // if the pod is not in ready state, return false // if the pod was restarted, return false