integration-tests/src/test/java/oracle/kubernetes/operator/ItPodsShutdown.java
@Test
  public void testAddShutdownOptionsToMsForced() throws Exception {

    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    Map<String, Object> shutdownProps = new HashMap();
    shutdownProps.put("shutdownType", "Forced");
    List<Map<String,Object>> shutdownPropsMSs = new ArrayList<>();
    Map<String, Object> shutdownPropsMyMS = new HashMap();
    shutdownPropsMyMS.put("managed-server1", shutdownProps);
    shutdownPropsMSs.add(shutdownPropsMyMS);
    Map<String, Object> shutdownPropOpt = new HashMap();
    shutdownPropOpt.put("server",shutdownPropsMSs);
    Domain domain = null;
    try {
      domain = createDomain(domainNSShutOpMSForced, shutdownPropOpt);
      Assertions.assertNotNull(domain,
          domainNSShutOpMSForced
              + " failed to create, returns null");
      Assertions.assertTrue(checkShutdownUpdatedProp(domain.getDomainUid()
          + "-managed-server1",domain.getDomainNs(), "Forced"),
          domain.getDomainUid()
              + "-managed-server1 :"
              + " shutdown properties don't not match the expected : "
              + "shutdownType=Forced");
      domain.buildDeployJavaAppInPod(
          testAppName, scriptName, BaseTest.getUsername(), BaseTest.getPassword());
      domain.callWebAppAndVerifyLoadBalancing(testAppName + "/CounterServlet?", false);
      long delayTime = 80 * 1000;
      // testing Forced
      long terminationTime = verifyShutdown(delayTime, domain);

      if ((delayTime < terminationTime)) {
        LoggerHelper.getLocal().log(Level.INFO, "\"FAILURE: ignored timeout Forced value during shutdown");
        throw new Exception("FAILURE: ignored timeout Forced during shutdown");
      }
    } finally {
      if (domain != null) {
        TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
      }
    }
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - {0}", testMethodName);
  }
/**
   * Add shutdown option Forced at managed server level and verify all pods are Terminated according
   * to the setting.
   *
   * @throws Exception If domain cannot be started or failed to verify shutdown options
   */
Add shutdown option Forced at managed server level and verify all pods are Terminated according
to the setting.

@throws Exception If domain cannot be started or failed to verify shutdown options
Add shutdown option Forced at managed server level and verify all pods are Terminated according to the setting . @throws Exception If domain cannot be started or failed to verify shutdown options
@Test
  public void testAddShutdownOptionsToMsForced() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    Map<String, Object> shutdownProps = new HashMap();
    shutdownProps.put("shutdownType", "Forced");
    List<Map<String,Object>> shutdownPropsMSs = new ArrayList<>();
    Map<String, Object> shutdownPropsMyMS = new HashMap();
    shutdownPropsMyMS.put("managed-server1", shutdownProps);
    shutdownPropsMSs.add(shutdownPropsMyMS);
    Map<String, Object> shutdownPropOpt = new HashMap();
    shutdownPropOpt.put("server",shutdownPropsMSs);
    Domain domain = null;
    try {
      domain = createDomain(domainNSShutOpMSForced, shutdownPropOpt);
      Assertions.assertNotNull(domain,
          domainNSShutOpMSForced
              + " failed to create, returns null");
      Assertions.assertTrue(checkShutdownUpdatedProp(domain.getDomainUid()
          + "-managed-server1",domain.getDomainNs(), "Forced"),
          domain.getDomainUid()
              + "-managed-server1 :"
              + " shutdown properties don't not match the expected : "
              + "shutdownType=Forced");
      domain.buildDeployJavaAppInPod(
          testAppName, scriptName, BaseTest.getUsername(), BaseTest.getPassword());
      domain.callWebAppAndVerifyLoadBalancing(testAppName + "/CounterServlet?", false);
      long delayTime = 80 * 1000;
      long terminationTime = verifyShutdown(delayTime, domain);
      if ((delayTime < terminationTime)) {
        LoggerHelper.getLocal().log(Level.INFO, "\"FAILURE: ignored timeout Forced value during shutdown");
        throw new Exception("FAILURE: ignored timeout Forced during shutdown");
      }
    } finally {
      if (domain != null) {
        TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
      }
    }
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - {0}", testMethodName);
  }
@ Test public void testAddShutdownOptionsToMsForced ( ) throws Exception { Assumptions . assumeTrue ( FULLTEST ) ; String testMethodName = new Object ( ) { } . getClass ( ) . getEnclosingMethod ( ) . getName ( ) ; logTestBegin ( testMethodName ) ; Map < String , Object > shutdownProps = new HashMap ( ) ; shutdownProps . put ( "shutdownType" , "Forced" ) ; List < Map < String , Object > > shutdownPropsMSs = new ArrayList < > ( ) ; Map < String , Object > shutdownPropsMyMS = new HashMap ( ) ; shutdownPropsMyMS . put ( "managed-server1" , shutdownProps ) ; shutdownPropsMSs . add ( shutdownPropsMyMS ) ; Map < String , Object > shutdownPropOpt = new HashMap ( ) ; shutdownPropOpt . put ( "server" , shutdownPropsMSs ) ; Domain domain = null ; try { domain = createDomain ( domainNSShutOpMSForced , shutdownPropOpt ) ; Assertions . assertNotNull ( domain , domainNSShutOpMSForced + " failed to create, returns null" ) ; Assertions . assertTrue ( checkShutdownUpdatedProp ( domain . getDomainUid ( ) + "-managed-server1" , domain . getDomainNs ( ) , "Forced" ) , domain . getDomainUid ( ) + "-managed-server1 :" + " shutdown properties don't not match the expected : " + "shutdownType=Forced" ) ; domain . buildDeployJavaAppInPod ( testAppName , scriptName , BaseTest . getUsername ( ) , BaseTest . getPassword ( ) ) ; domain . callWebAppAndVerifyLoadBalancing ( testAppName + "/CounterServlet?" , false ) ; long delayTime = 80 * 1000 ; long terminationTime = verifyShutdown ( delayTime , domain ) ; if ( ( delayTime < terminationTime ) ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "\"FAILURE: ignored timeout Forced value during shutdown" ) ; throw new Exception ( "FAILURE: ignored timeout Forced during shutdown" ) ; } } finally { if ( domain != null ) { TestUtils . deleteWeblogicDomainResources ( domain . getDomainUid ( ) ) ; } } LoggerHelper . getLocal ( ) . log ( Level . INFO , "SUCCESS - {0}" , testMethodName ) ; }
Add shutdown option Forced at managed server level and verify all pods are Terminated according
 to the setting.
Add shutdown option Forced at managed server level and verify all pods are Terminated according to the setting .
// testing Forced