integration-tests/src/test/java/oracle/kubernetes/operator/ItPodsShutdown.java
@Test
  public void testAddShutdownOptionsEnv() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);

    Map<String, String> shutdownEnvProps = new HashMap();
    shutdownEnvProps.put("SHUTDOWN_TYPE", "Forced");
    shutdownEnvProps.put("SHUTDOWN_TIMEOUT", "60");
    shutdownEnvProps.put("SHUTDOWN_IGNORE_SESSIONS", "false");
    Map<String, Object> shutdownProps = new HashMap<>();
    shutdownProps.put("env",shutdownEnvProps);
    Domain domain = null;
    try {
      domain = createDomain(domainNSShutOpEnv,shutdownProps);
      Assertions.assertNotNull(domain,
          domainNSShutOpEnv
              + " failed to create, returns null");
      Assertions.assertTrue(checkShutdownUpdatedProp(domain.getDomainUid()
          + "-managed-server1", domain.getDomainNs(), "Forced", "60", "false"),
          domain.getDomainUid()
              + "-managed-server1 :"
              + " shutdown properties don't not match the expected : "
              + "shutdownType=Forced, timeoutSeconds=60, ignoreSessions=false");
      Assertions.assertTrue(checkShutdownUpdatedProp(domain.getDomainUid()
          + "-admin-server", domain.getDomainNs(),"Forced", "60", "false"),
          domain.getDomainUid()
              + "-admin-server :"
              + " shutdown properties don't not match the expected : "
              + "shutdownType=Forced, timeoutSeconds=60, ignoreSessions=false");
    } finally {
      if (domain != null) {
        TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
      }
    }
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - {0}", testMethodName);
  }
/**
   * Add shutdown env vars at domain spec level and verify the pod are Terminated and recreated.
   *
   * @throws Exception If domain cannot be started or failed to verify shutdown options
   */
Add shutdown env vars at domain spec level and verify the pod are Terminated and recreated.
@throws Exception If domain cannot be started or failed to verify shutdown options
Add shutdown env vars at domain spec level and verify the pod are Terminated and recreated . @throws Exception If domain cannot be started or failed to verify shutdown options
@Test
  public void testAddShutdownOptionsEnv() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    Map<String, String> shutdownEnvProps = new HashMap();
    shutdownEnvProps.put("SHUTDOWN_TYPE", "Forced");
    shutdownEnvProps.put("SHUTDOWN_TIMEOUT", "60");
    shutdownEnvProps.put("SHUTDOWN_IGNORE_SESSIONS", "false");
    Map<String, Object> shutdownProps = new HashMap<>();
    shutdownProps.put("env",shutdownEnvProps);
    Domain domain = null;
    try {
      domain = createDomain(domainNSShutOpEnv,shutdownProps);
      Assertions.assertNotNull(domain,
          domainNSShutOpEnv
              + " failed to create, returns null");
      Assertions.assertTrue(checkShutdownUpdatedProp(domain.getDomainUid()
          + "-managed-server1", domain.getDomainNs(), "Forced", "60", "false"),
          domain.getDomainUid()
              + "-managed-server1 :"
              + " shutdown properties don't not match the expected : "
              + "shutdownType=Forced, timeoutSeconds=60, ignoreSessions=false");
      Assertions.assertTrue(checkShutdownUpdatedProp(domain.getDomainUid()
          + "-admin-server", domain.getDomainNs(),"Forced", "60", "false"),
          domain.getDomainUid()
              + "-admin-server :"
              + " shutdown properties don't not match the expected : "
              + "shutdownType=Forced, timeoutSeconds=60, ignoreSessions=false");
    } finally {
      if (domain != null) {
        TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
      }
    }
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - {0}", testMethodName);
  }
@ Test public void testAddShutdownOptionsEnv ( ) throws Exception { Assumptions . assumeTrue ( FULLTEST ) ; String testMethodName = new Object ( ) { } . getClass ( ) . getEnclosingMethod ( ) . getName ( ) ; logTestBegin ( testMethodName ) ; Map < String , String > shutdownEnvProps = new HashMap ( ) ; shutdownEnvProps . put ( "SHUTDOWN_TYPE" , "Forced" ) ; shutdownEnvProps . put ( "SHUTDOWN_TIMEOUT" , "60" ) ; shutdownEnvProps . put ( "SHUTDOWN_IGNORE_SESSIONS" , "false" ) ; Map < String , Object > shutdownProps = new HashMap < > ( ) ; shutdownProps . put ( "env" , shutdownEnvProps ) ; Domain domain = null ; try { domain = createDomain ( domainNSShutOpEnv , shutdownProps ) ; Assertions . assertNotNull ( domain , domainNSShutOpEnv + " failed to create, returns null" ) ; Assertions . assertTrue ( checkShutdownUpdatedProp ( domain . getDomainUid ( ) + "-managed-server1" , domain . getDomainNs ( ) , "Forced" , "60" , "false" ) , domain . getDomainUid ( ) + "-managed-server1 :" + " shutdown properties don't not match the expected : " + "shutdownType=Forced, timeoutSeconds=60, ignoreSessions=false" ) ; Assertions . assertTrue ( checkShutdownUpdatedProp ( domain . getDomainUid ( ) + "-admin-server" , domain . getDomainNs ( ) , "Forced" , "60" , "false" ) , domain . getDomainUid ( ) + "-admin-server :" + " shutdown properties don't not match the expected : " + "shutdownType=Forced, timeoutSeconds=60, ignoreSessions=false" ) ; } finally { if ( domain != null ) { TestUtils . deleteWeblogicDomainResources ( domain . getDomainUid ( ) ) ; } } LoggerHelper . getLocal ( ) . log ( Level . INFO , "SUCCESS - {0}" , testMethodName ) ; }
Add shutdown env vars at domain spec level and verify the pod are Terminated and recreated.
Add shutdown env vars at domain spec level and verify the pod are Terminated and recreated .