new-integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/TestActions.java
public static String patchDomainResourceWithNewRestartVersion(
      String domainResourceName, String namespace) {
    LoggingFacade logger = getLogger();
    String oldVersion = assertDoesNotThrow(
        () -> getDomainCustomResource(domainResourceName, namespace).getSpec().getRestartVersion(),
        String.format("Failed to get the restartVersion of %s in namespace %s", domainResourceName, namespace));
    int newVersion = oldVersion == null ? 1 : Integer.valueOf(oldVersion) + 1;
    logger.info("Update domain resource {0} in namespace {1} restartVersion from {2} to {3}",
        domainResourceName, namespace, oldVersion, newVersion);

    StringBuffer patchStr = new StringBuffer("[{");
    patchStr.append(" \"op\": \"replace\",")
        .append(" \"path\": \"/spec/restartVersion\",")
        .append(" \"value\": \"")
        .append(newVersion)
        .append("\"")
        .append(" }]");

    logger.info("Restart version patch string: {0}", patchStr);
    V1Patch patch = new V1Patch(new String(patchStr));
    boolean rvPatched = assertDoesNotThrow(() ->
            patchDomainCustomResource(domainResourceName, namespace, patch, "application/json-patch+json"),
        "patchDomainCustomResource(restartVersion)  failed ");
    assertTrue(rvPatched, "patchDomainCustomResource(restartVersion) failed");

    return String.valueOf(newVersion);
  }
/**
   * Patch the domain resource with a new restartVersion.
   *
   * @param domainResourceName name of the domain resource
   * @param namespace Kubernetes namespace that the domain is hosted
   * @return restartVersion new restartVersion of the domain resource
   */
Patch the domain resource with a new restartVersion.
@param domainResourceName name of the domain resource
@param namespace Kubernetes namespace that the domain is hosted
@return restartVersion new restartVersion of the domain resource
Patch the domain resource with a new restartVersion . @param domainResourceName name of the domain resource @param namespace Kubernetes namespace that the domain is hosted @return restartVersion new restartVersion of the domain resource
public static String patchDomainResourceWithNewRestartVersion(
      String domainResourceName, String namespace) {
    LoggingFacade logger = getLogger();
    String oldVersion = assertDoesNotThrow(
        () -> getDomainCustomResource(domainResourceName, namespace).getSpec().getRestartVersion(),
        String.format("Failed to get the restartVersion of %s in namespace %s", domainResourceName, namespace));
    int newVersion = oldVersion == null ? 1 : Integer.valueOf(oldVersion) + 1;
    logger.info("Update domain resource {0} in namespace {1} restartVersion from {2} to {3}",
        domainResourceName, namespace, oldVersion, newVersion);
    StringBuffer patchStr = new StringBuffer("[{");
    patchStr.append(" \"op\": \"replace\",")
        .append(" \"path\": \"/spec/restartVersion\",")
        .append(" \"value\": \"")
        .append(newVersion)
        .append("\"")
        .append(" }]");
    logger.info("Restart version patch string: {0}", patchStr);
    V1Patch patch = new V1Patch(new String(patchStr));
    boolean rvPatched = assertDoesNotThrow(() ->
            patchDomainCustomResource(domainResourceName, namespace, patch, "application/json-patch+json"),
        "patchDomainCustomResource(restartVersion)  failed ");
    assertTrue(rvPatched, "patchDomainCustomResource(restartVersion) failed");
    return String.valueOf(newVersion);
  }
public static String patchDomainResourceWithNewRestartVersion ( String domainResourceName , String namespace ) { LoggingFacade logger = getLogger ( ) ; String oldVersion = assertDoesNotThrow ( ( ) -> getDomainCustomResource ( domainResourceName , namespace ) . getSpec ( ) . getRestartVersion ( ) , String . format ( "Failed to get the restartVersion of %s in namespace %s" , domainResourceName , namespace ) ) ; int newVersion = oldVersion == null ? 1 : Integer . valueOf ( oldVersion ) + 1 ; logger . info ( "Update domain resource {0} in namespace {1} restartVersion from {2} to {3}" , domainResourceName , namespace , oldVersion , newVersion ) ; StringBuffer patchStr = new StringBuffer ( "[{" ) ; patchStr . append ( " \"op\": \"replace\"," ) . append ( " \"path\": \"/spec/restartVersion\"," ) . append ( " \"value\": \"" ) . append ( newVersion ) . append ( "\"" ) . append ( " }]" ) ; logger . info ( "Restart version patch string: {0}" , patchStr ) ; V1Patch patch = new V1Patch ( new String ( patchStr ) ) ; boolean rvPatched = assertDoesNotThrow ( ( ) -> patchDomainCustomResource ( domainResourceName , namespace , patch , "application/json-patch+json" ) , "patchDomainCustomResource(restartVersion)  failed " ) ; assertTrue ( rvPatched , "patchDomainCustomResource(restartVersion) failed" ) ; return String . valueOf ( newVersion ) ; }
Patch the domain resource with a new restartVersion.
Patch the domain resource with a new restartVersion .