new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItConfigDistributionStrategy.java
@Order(1)
  @Test
  @DisplayName("Test overrideDistributionStrategy set to DEFAULT")
  public void testDefaultOverride() {

    //store the pod creation timestamps
    storePodCreationTimestamps();

    List<Path> overrideFiles = new ArrayList<>();
    overrideFiles.add(
        Paths.get(RESOURCE_DIR, "configfiles/configoverridesset1/jdbc-JdbcTestDataSource-0.xml"));
    overrideFiles.add(Paths.get(RESOURCE_DIR, "configfiles/configoverridesset1/config.xml"));
    overrideFiles.add(Paths.get(RESOURCE_DIR, "configfiles/configoverridesset1/version.txt"));

    //create config override map
    createConfigMapFromFiles(overridecm, overrideFiles, domainNamespace);

    String introspectVersion = assertDoesNotThrow(() -> getNextIntrospectVersion(domainUid, domainNamespace));

    logger.info("patch the domain resource with overridesConfigMap and introspectVersion");
    String patchStr
        = "["
        + "{\"op\": \"add\", \"path\": \"/spec/configuration/overridesConfigMap\", \"value\": \"" + overridecm + "\"},"
        + "{\"op\": \"add\", \"path\": \"/spec/introspectVersion\", \"value\": \"" + introspectVersion + "\"}"
        + "]";
    logger.info("Updating domain configuration using patch string: {0}", patchStr);
    V1Patch patch = new V1Patch(patchStr);
    assertTrue(patchDomainCustomResource(domainUid, domainNamespace, patch, V1Patch.PATCH_FORMAT_JSON_PATCH),
        "Failed to patch domain");

    verifyIntrospectorRuns();
    verifyPodsStateNotChanged();

    //wait until config is updated upto 5 minutes
    withStandardRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for server configuration to be updated"
                + "(elapsed time {0} ms, remaining time {1} ms)",
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(configUpdated("9999999"));

    verifyConfigXMLOverride(true);
    verifyResourceJDBC0Override(true);
  }
/**
   * Test server configuration and JDBC datasource configurations are overridden dynamically when
   * /spec/configuration/overrideDistributionStrategy: field is not set. By default it should be DYNAMIC.
   *
   * <p>Test sets the /spec/configuration/overridesConfigMap and with new configuration for config.xml and datasources.
   *
   * <p>Verifies after introspector runs the server configuration and JDBC datasource configurations are updated
   * as expected.
   */
Test server configuration and JDBC datasource configurations are overridden dynamically when
/spec/configuration/overrideDistributionStrategy: field is not set. By default it should be DYNAMIC.

Test sets the /spec/configuration/overridesConfigMap and with new configuration for config.xml and datasources.

Verifies after introspector runs the server configuration and JDBC datasource configurations are updated
as expected.
Test server configuration and JDBC datasource configurations are overridden dynamically when / spec / configuration / overrideDistributionStrategy : field is not set . By default it should be DYNAMIC . Test sets the / spec / configuration / overridesConfigMap and with new configuration for config . xml and datasources . Verifies after introspector runs the server configuration and JDBC datasource configurations are updated as expected .
@Order(1)
  @Test
  @DisplayName("Test overrideDistributionStrategy set to DEFAULT")
  public void testDefaultOverride() {
    storePodCreationTimestamps();
    List<Path> overrideFiles = new ArrayList<>();
    overrideFiles.add(
        Paths.get(RESOURCE_DIR, "configfiles/configoverridesset1/jdbc-JdbcTestDataSource-0.xml"));
    overrideFiles.add(Paths.get(RESOURCE_DIR, "configfiles/configoverridesset1/config.xml"));
    overrideFiles.add(Paths.get(RESOURCE_DIR, "configfiles/configoverridesset1/version.txt"));
    createConfigMapFromFiles(overridecm, overrideFiles, domainNamespace);
    String introspectVersion = assertDoesNotThrow(() -> getNextIntrospectVersion(domainUid, domainNamespace));
    logger.info("patch the domain resource with overridesConfigMap and introspectVersion");
    String patchStr
        = "["
        + "{\"op\": \"add\", \"path\": \"/spec/configuration/overridesConfigMap\", \"value\": \"" + overridecm + "\"},"
        + "{\"op\": \"add\", \"path\": \"/spec/introspectVersion\", \"value\": \"" + introspectVersion + "\"}"
        + "]";
    logger.info("Updating domain configuration using patch string: {0}", patchStr);
    V1Patch patch = new V1Patch(patchStr);
    assertTrue(patchDomainCustomResource(domainUid, domainNamespace, patch, V1Patch.PATCH_FORMAT_JSON_PATCH),
        "Failed to patch domain");
    verifyIntrospectorRuns();
    verifyPodsStateNotChanged();
    withStandardRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for server configuration to be updated"
                + "(elapsed time {0} ms, remaining time {1} ms)",
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(configUpdated("9999999"));
    verifyConfigXMLOverride(true);
    verifyResourceJDBC0Override(true);
  }
@ Order ( 1 ) @ Test @ DisplayName ( "Test overrideDistributionStrategy set to DEFAULT" ) public void testDefaultOverride ( ) { storePodCreationTimestamps ( ) ; List < Path > overrideFiles = new ArrayList < > ( ) ; overrideFiles . add ( Paths . get ( RESOURCE_DIR , "configfiles/configoverridesset1/jdbc-JdbcTestDataSource-0.xml" ) ) ; overrideFiles . add ( Paths . get ( RESOURCE_DIR , "configfiles/configoverridesset1/config.xml" ) ) ; overrideFiles . add ( Paths . get ( RESOURCE_DIR , "configfiles/configoverridesset1/version.txt" ) ) ; createConfigMapFromFiles ( overridecm , overrideFiles , domainNamespace ) ; String introspectVersion = assertDoesNotThrow ( ( ) -> getNextIntrospectVersion ( domainUid , domainNamespace ) ) ; logger . info ( "patch the domain resource with overridesConfigMap and introspectVersion" ) ; String patchStr = "[" + "{\"op\": \"add\", \"path\": \"/spec/configuration/overridesConfigMap\", \"value\": \"" + overridecm + "\"}," + "{\"op\": \"add\", \"path\": \"/spec/introspectVersion\", \"value\": \"" + introspectVersion + "\"}" + "]" ; logger . info ( "Updating domain configuration using patch string: {0}" , patchStr ) ; V1Patch patch = new V1Patch ( patchStr ) ; assertTrue ( patchDomainCustomResource ( domainUid , domainNamespace , patch , V1Patch . PATCH_FORMAT_JSON_PATCH ) , "Failed to patch domain" ) ; verifyIntrospectorRuns ( ) ; verifyPodsStateNotChanged ( ) ; withStandardRetryPolicy . conditionEvaluationListener ( condition -> logger . info ( "Waiting for server configuration to be updated" + "(elapsed time {0} ms, remaining time {1} ms)" , condition . getElapsedTimeInMS ( ) , condition . getRemainingTimeInMS ( ) ) ) . until ( configUpdated ( "9999999" ) ) ; verifyConfigXMLOverride ( true ) ; verifyResourceJDBC0Override ( true ) ; }
Test server configuration and JDBC datasource configurations are overridden dynamically when
 /spec/configuration/overrideDistributionStrategy: field is not set.
Test server configuration and JDBC datasource configurations are overridden dynamically when / spec / configuration / overrideDistributionStrategy : field is not set .
//store the pod creation timestamps //create config override map //wait until config is updated upto 5 minutes