integration-tests/src/test/java/oracle/kubernetes/operator/ItMiiConfigUpdateCm.java
@Test
  public void testMiiConfigAppDelete() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    boolean testCompletedSuccessfully = false;
    Domain domain = null;

    try {
      logTestBegin(testMethodName);

      // create Domain with JDBC DataSource and application using the image created by MII
      LoggerHelper.getLocal().log(Level.INFO,
          "Creating Domain & waiting for the script to complete execution");
      boolean createDS = true;
      domain = createDomainUsingMii(createDS, domainNS, testClassName);
      assertNotNull(domain, "Failed to create a domain");

      // verify that JDBC DS is created by checking JDBC DS name and read timeout
      // verify the test result by checking override config file on server pod
      // verify that application is accessible from inside the managed server pod
      String jdbcDsStr = getJndiName(domain);
      assertTrue(verifyApp().contains("Hello"), "Application is not found");

      // delete config and application using new model file
      wdtConfigDeleteOverride(domain);

      // patch to change domain-level restart version and verify domain restarted successfully
      modifyDomainYamlWithRestartVersion(domain);

      // verify the test result by getting JDBC DS via WLST on server pod
      String destDir = getResultDir() + "/samples/model-in-image-override";
      String jdbcResources = getJdbcResources(destDir, domain);
      assertFalse(jdbcResources.contains(dsName), dsName + " is found");

      // verify the app access returns 404
      assertFalse(verifyApp().contains("Hello"), "Application is found");

      testCompletedSuccessfully = true;
    } catch (Exception ex) {
      fail("FAILED - " + testMethodName);
    } finally {
      if (domain != null && (JENKINS || testCompletedSuccessfully)) {
        try {
          TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
        } catch (Exception ex) {
          LoggerHelper.getLocal().log(Level.INFO, "Failed to delete domain.\n " + ex.getMessage());
        }
      }
    }

    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - " + testMethodName);
  }
/**
   * Create a domain using model in image and having config map in the domain.yaml
   * The model file has predeployed application and a JDBC DataSource. After the domain
   * resources is created, re-create the config map with a model file that removes the JDBC
   * and application through the ! notation and patch the domain to change domain
   * restartVersion to reload the model, generate new config and initiate a rolling restart.
   * Verify the JDBC DataSource and application no longer exists in the WebLogic domain.
   *
   * @throws Exception when test fails
   */
Create a domain using model in image and having config map in the domain.yaml
The model file has predeployed application and a JDBC DataSource. After the domain
resources is created, re-create the config map with a model file that removes the JDBC
and application through the . notation and patch the domain to change domain
restartVersion to reload the model, generate new config and initiate a rolling restart.
Verify the JDBC DataSource and application no longer exists in the WebLogic domain.

@throws Exception when test fails
Create a domain using model in image and having config map in the domain . yaml The model file has predeployed application and a JDBC DataSource . After the domain resources is created re - create the config map with a model file that removes the JDBC and application through the . notation and patch the domain to change domain restartVersion to reload the model generate new config and initiate a rolling restart . Verify the JDBC DataSource and application no longer exists in the WebLogic domain . @throws Exception when test fails
@Test
  public void testMiiConfigAppDelete() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    boolean testCompletedSuccessfully = false;
    Domain domain = null;
    try {
      logTestBegin(testMethodName);
      LoggerHelper.getLocal().log(Level.INFO,
          "Creating Domain & waiting for the script to complete execution");
      boolean createDS = true;
      domain = createDomainUsingMii(createDS, domainNS, testClassName);
      assertNotNull(domain, "Failed to create a domain");
      String jdbcDsStr = getJndiName(domain);
      assertTrue(verifyApp().contains("Hello"), "Application is not found");
      wdtConfigDeleteOverride(domain);
      modifyDomainYamlWithRestartVersion(domain);
      String destDir = getResultDir() + "/samples/model-in-image-override";
      String jdbcResources = getJdbcResources(destDir, domain);
      assertFalse(jdbcResources.contains(dsName), dsName + " is found");
      assertFalse(verifyApp().contains("Hello"), "Application is found");
      testCompletedSuccessfully = true;
    } catch (Exception ex) {
      fail("FAILED - " + testMethodName);
    } finally {
      if (domain != null && (JENKINS || testCompletedSuccessfully)) {
        try {
          TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
        } catch (Exception ex) {
          LoggerHelper.getLocal().log(Level.INFO, "Failed to delete domain.\n " + ex.getMessage());
        }
      }
    }
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - " + testMethodName);
  }
@ Test public void testMiiConfigAppDelete ( ) throws Exception { Assumptions . assumeTrue ( FULLTEST ) ; String testMethodName = new Object ( ) { } . getClass ( ) . getEnclosingMethod ( ) . getName ( ) ; boolean testCompletedSuccessfully = false ; Domain domain = null ; try { logTestBegin ( testMethodName ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Creating Domain & waiting for the script to complete execution" ) ; boolean createDS = true ; domain = createDomainUsingMii ( createDS , domainNS , testClassName ) ; assertNotNull ( domain , "Failed to create a domain" ) ; String jdbcDsStr = getJndiName ( domain ) ; assertTrue ( verifyApp ( ) . contains ( "Hello" ) , "Application is not found" ) ; wdtConfigDeleteOverride ( domain ) ; modifyDomainYamlWithRestartVersion ( domain ) ; String destDir = getResultDir ( ) + "/samples/model-in-image-override" ; String jdbcResources = getJdbcResources ( destDir , domain ) ; assertFalse ( jdbcResources . contains ( dsName ) , dsName + " is found" ) ; assertFalse ( verifyApp ( ) . contains ( "Hello" ) , "Application is found" ) ; testCompletedSuccessfully = true ; } catch ( Exception ex ) { fail ( "FAILED - " + testMethodName ) ; } finally { if ( domain != null && ( JENKINS || testCompletedSuccessfully ) ) { try { TestUtils . deleteWeblogicDomainResources ( domain . getDomainUid ( ) ) ; } catch ( Exception ex ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Failed to delete domain.\n " + ex . getMessage ( ) ) ; } } } LoggerHelper . getLocal ( ) . log ( Level . INFO , "SUCCESS - " + testMethodName ) ; }
Create a domain using model in image and having config map in the domain.yaml
 The model file has predeployed application and a JDBC DataSource.
Create a domain using model in image and having config map in the domain . yaml The model file has predeployed application and a JDBC DataSource .
// create Domain with JDBC DataSource and application using the image created by MII // verify that JDBC DS is created by checking JDBC DS name and read timeout // verify the test result by checking override config file on server pod // verify that application is accessible from inside the managed server pod // delete config and application using new model file // patch to change domain-level restart version and verify domain restarted successfully // verify the test result by getting JDBC DS via WLST on server pod // verify the app access returns 404