new-integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonTestUtils.java
public static void createPVPVCAndVerify(V1PersistentVolume v1pv,
                                          V1PersistentVolumeClaim v1pvc,
                                          String labelSelector,
                                          String namespace) {
    LoggingFacade logger = getLogger();
    assertNotNull(v1pv, "v1pv is null");
    assertNotNull(v1pvc, "v1pvc is null");

    String pvName = v1pv.getMetadata().getName();
    String pvcName = v1pvc.getMetadata().getName();

    logger.info("Creating persistent volume {0}", pvName);
    assertTrue(assertDoesNotThrow(() -> createPersistentVolume(v1pv),
        "Persistent volume creation failed with ApiException "),
        "PersistentVolume creation failed");

    logger.info("Creating persistent volume claim {0}", pvcName);
    assertTrue(assertDoesNotThrow(() -> createPersistentVolumeClaim(v1pvc),
        "Persistent volume claim creation failed with ApiException"),
        "PersistentVolumeClaim creation failed");

    // check the persistent volume and persistent volume claim exist
    withStandardRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for persistent volume {0} exists "
                    + "(elapsed time {1}ms, remaining time {2}ms)",
                pvName,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(assertDoesNotThrow(() -> pvExists(pvName, labelSelector),
            String.format("pvExists failed with ApiException when checking pv %s", pvName)));

    withStandardRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for persistent volume claim {0} exists in namespace {1} "
                    + "(elapsed time {2}ms, remaining time {3}ms)",
                pvcName,
                namespace,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(assertDoesNotThrow(() -> pvcExists(pvcName, namespace),
            String.format("pvcExists failed with ApiException when checking pvc %s in namespace %s",
                pvcName, namespace)));
  }
/**
   * Create a persistent volume and persistent volume claim.
   *
   * @param v1pv V1PersistentVolume object to create the persistent volume
   * @param v1pvc V1PersistentVolumeClaim object to create the persistent volume claim
   * @param labelSelector String containing the labels the PV is decorated with
   * @param namespace the namespace in which the persistence volume claim to be created
   *
   **/
Create a persistent volume and persistent volume claim.
@param v1pv V1PersistentVolume object to create the persistent volume
@param v1pvc V1PersistentVolumeClaim object to create the persistent volume claim
@param labelSelector String containing the labels the PV is decorated with
@param namespace the namespace in which the persistence volume claim to be created
Create a persistent volume and persistent volume claim . @param v1pv V1PersistentVolume object to create the persistent volume @param v1pvc V1PersistentVolumeClaim object to create the persistent volume claim @param labelSelector String containing the labels the PV is decorated with @param namespace the namespace in which the persistence volume claim to be created
public static void createPVPVCAndVerify(V1PersistentVolume v1pv,
                                          V1PersistentVolumeClaim v1pvc,
                                          String labelSelector,
                                          String namespace) {
    LoggingFacade logger = getLogger();
    assertNotNull(v1pv, "v1pv is null");
    assertNotNull(v1pvc, "v1pvc is null");
    String pvName = v1pv.getMetadata().getName();
    String pvcName = v1pvc.getMetadata().getName();
    logger.info("Creating persistent volume {0}", pvName);
    assertTrue(assertDoesNotThrow(() -> createPersistentVolume(v1pv),
        "Persistent volume creation failed with ApiException "),
        "PersistentVolume creation failed");
    logger.info("Creating persistent volume claim {0}", pvcName);
    assertTrue(assertDoesNotThrow(() -> createPersistentVolumeClaim(v1pvc),
        "Persistent volume claim creation failed with ApiException"),
        "PersistentVolumeClaim creation failed");
    withStandardRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for persistent volume {0} exists "
                    + "(elapsed time {1}ms, remaining time {2}ms)",
                pvName,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(assertDoesNotThrow(() -> pvExists(pvName, labelSelector),
            String.format("pvExists failed with ApiException when checking pv %s", pvName)));
    withStandardRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for persistent volume claim {0} exists in namespace {1} "
                    + "(elapsed time {2}ms, remaining time {3}ms)",
                pvcName,
                namespace,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(assertDoesNotThrow(() -> pvcExists(pvcName, namespace),
            String.format("pvcExists failed with ApiException when checking pvc %s in namespace %s",
                pvcName, namespace)));
  }
public static void createPVPVCAndVerify ( V1PersistentVolume v1pv , V1PersistentVolumeClaim v1pvc , String labelSelector , String namespace ) { LoggingFacade logger = getLogger ( ) ; assertNotNull ( v1pv , "v1pv is null" ) ; assertNotNull ( v1pvc , "v1pvc is null" ) ; String pvName = v1pv . getMetadata ( ) . getName ( ) ; String pvcName = v1pvc . getMetadata ( ) . getName ( ) ; logger . info ( "Creating persistent volume {0}" , pvName ) ; assertTrue ( assertDoesNotThrow ( ( ) -> createPersistentVolume ( v1pv ) , "Persistent volume creation failed with ApiException " ) , "PersistentVolume creation failed" ) ; logger . info ( "Creating persistent volume claim {0}" , pvcName ) ; assertTrue ( assertDoesNotThrow ( ( ) -> createPersistentVolumeClaim ( v1pvc ) , "Persistent volume claim creation failed with ApiException" ) , "PersistentVolumeClaim creation failed" ) ; withStandardRetryPolicy . conditionEvaluationListener ( condition -> logger . info ( "Waiting for persistent volume {0} exists " + "(elapsed time {1}ms, remaining time {2}ms)" , pvName , condition . getElapsedTimeInMS ( ) , condition . getRemainingTimeInMS ( ) ) ) . until ( assertDoesNotThrow ( ( ) -> pvExists ( pvName , labelSelector ) , String . format ( "pvExists failed with ApiException when checking pv %s" , pvName ) ) ) ; withStandardRetryPolicy . conditionEvaluationListener ( condition -> logger . info ( "Waiting for persistent volume claim {0} exists in namespace {1} " + "(elapsed time {2}ms, remaining time {3}ms)" , pvcName , namespace , condition . getElapsedTimeInMS ( ) , condition . getRemainingTimeInMS ( ) ) ) . until ( assertDoesNotThrow ( ( ) -> pvcExists ( pvcName , namespace ) , String . format ( "pvcExists failed with ApiException when checking pvc %s in namespace %s" , pvcName , namespace ) ) ) ; }
Create a persistent volume and persistent volume claim.
Create a persistent volume and persistent volume claim .
// check the persistent volume and persistent volume claim exist