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

    Map<String, Object> shutdownProps = new HashMap();
    shutdownProps.put("timeoutSeconds", 20);
    shutdownProps.put("shutdownType", "Forced");
    shutdownProps.put("ignoreSessions", false);
    List<Map<String,Object>> shutdownPropsClusters = new ArrayList<>();
    Map<String, Object> shutdownPropsMyCluster = new HashMap();
    shutdownPropsMyCluster.put("cluster-1", shutdownProps);
    shutdownPropsClusters.add(shutdownPropsMyCluster);
    Map<String, Object> shutdownPropOpt = new HashMap();
    shutdownPropOpt.put("cluster",shutdownPropsClusters);

    Map<String, Object> shutdownProps1 = new HashMap();
    shutdownProps1.put("shutdownType", "Graceful");
    List<Map<String,Object>> shutdownPropsMSs = new ArrayList<>();
    Map<String, Object> shutdownPropsMyMS = new HashMap();
    shutdownPropsMyMS.put("managed-server1", shutdownProps1);
    shutdownPropsMSs.add(shutdownPropsMyMS);
    shutdownPropOpt.put("server",shutdownPropsMSs);

    Domain domain = null;
    try {
      domain = createDomain(domainNSShutOpOverrideViaCluster, shutdownPropOpt);
      Assertions.assertNotNull(domain,
          domainNSShutOpOverrideViaCluster
              + " failed to create, returns null");
      // scale up to 2 replicas to check both managed servers in the cluster
      scaleCluster(2, domain);
      Assertions.assertTrue(checkShutdownUpdatedProp(domain.getDomainUid()
              + "-managed-server1", domain.getDomainNs(),"Graceful"),
          domain.getDomainUid()
              + "-managed-server1 :"
              + " shutdown properties don't not match the expected : "
              + "shutdownType=Graceful");
      Assertions.assertTrue(checkShutdownUpdatedProp(domain.getDomainUid()
              + "-managed-server2", domain.getDomainNs(),"Forced"),
          domain.getDomainUid()
              + "-managed-server2 :"
              + " shutdown properties don't not match the expected : "
              + "shutdownType=Forced");
    } finally {
      if (domain != null) {
        TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
      }
    }
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - {0}", testMethodName);
  }
/**
   * Add shutdown options at cluster spec level and the managed server1 level,verify managed server
   * override cluster level.
   *
   * @throws Exception If domain fails to start or can't verify the expected behavior
   */
Add shutdown options at cluster spec level and the managed server1 level,verify managed server
override cluster level.

@throws Exception If domain fails to start or can't verify the expected behavior
Add shutdown options at cluster spec level and the managed server1 level verify managed server override cluster level . @throws Exception If domain fails to start or can ' t verify the expected behavior
@Test
  public void testShutdownOptionsOverrideClusterLevel() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    Map<String, Object> shutdownProps = new HashMap();
    shutdownProps.put("timeoutSeconds", 20);
    shutdownProps.put("shutdownType", "Forced");
    shutdownProps.put("ignoreSessions", false);
    List<Map<String,Object>> shutdownPropsClusters = new ArrayList<>();
    Map<String, Object> shutdownPropsMyCluster = new HashMap();
    shutdownPropsMyCluster.put("cluster-1", shutdownProps);
    shutdownPropsClusters.add(shutdownPropsMyCluster);
    Map<String, Object> shutdownPropOpt = new HashMap();
    shutdownPropOpt.put("cluster",shutdownPropsClusters);
    Map<String, Object> shutdownProps1 = new HashMap();
    shutdownProps1.put("shutdownType", "Graceful");
    List<Map<String,Object>> shutdownPropsMSs = new ArrayList<>();
    Map<String, Object> shutdownPropsMyMS = new HashMap();
    shutdownPropsMyMS.put("managed-server1", shutdownProps1);
    shutdownPropsMSs.add(shutdownPropsMyMS);
    shutdownPropOpt.put("server",shutdownPropsMSs);
    Domain domain = null;
    try {
      domain = createDomain(domainNSShutOpOverrideViaCluster, shutdownPropOpt);
      Assertions.assertNotNull(domain,
          domainNSShutOpOverrideViaCluster
              + " failed to create, returns null");
      scaleCluster(2, domain);
      Assertions.assertTrue(checkShutdownUpdatedProp(domain.getDomainUid()
              + "-managed-server1", domain.getDomainNs(),"Graceful"),
          domain.getDomainUid()
              + "-managed-server1 :"
              + " shutdown properties don't not match the expected : "
              + "shutdownType=Graceful");
      Assertions.assertTrue(checkShutdownUpdatedProp(domain.getDomainUid()
              + "-managed-server2", domain.getDomainNs(),"Forced"),
          domain.getDomainUid()
              + "-managed-server2 :"
              + " shutdown properties don't not match the expected : "
              + "shutdownType=Forced");
    } finally {
      if (domain != null) {
        TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
      }
    }
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - {0}", testMethodName);
  }
@ Test public void testShutdownOptionsOverrideClusterLevel ( ) throws Exception { Assumptions . assumeTrue ( FULLTEST ) ; String testMethodName = new Object ( ) { } . getClass ( ) . getEnclosingMethod ( ) . getName ( ) ; logTestBegin ( testMethodName ) ; Map < String , Object > shutdownProps = new HashMap ( ) ; shutdownProps . put ( "timeoutSeconds" , 20 ) ; shutdownProps . put ( "shutdownType" , "Forced" ) ; shutdownProps . put ( "ignoreSessions" , false ) ; List < Map < String , Object > > shutdownPropsClusters = new ArrayList < > ( ) ; Map < String , Object > shutdownPropsMyCluster = new HashMap ( ) ; shutdownPropsMyCluster . put ( "cluster-1" , shutdownProps ) ; shutdownPropsClusters . add ( shutdownPropsMyCluster ) ; Map < String , Object > shutdownPropOpt = new HashMap ( ) ; shutdownPropOpt . put ( "cluster" , shutdownPropsClusters ) ; Map < String , Object > shutdownProps1 = new HashMap ( ) ; shutdownProps1 . put ( "shutdownType" , "Graceful" ) ; List < Map < String , Object > > shutdownPropsMSs = new ArrayList < > ( ) ; Map < String , Object > shutdownPropsMyMS = new HashMap ( ) ; shutdownPropsMyMS . put ( "managed-server1" , shutdownProps1 ) ; shutdownPropsMSs . add ( shutdownPropsMyMS ) ; shutdownPropOpt . put ( "server" , shutdownPropsMSs ) ; Domain domain = null ; try { domain = createDomain ( domainNSShutOpOverrideViaCluster , shutdownPropOpt ) ; Assertions . assertNotNull ( domain , domainNSShutOpOverrideViaCluster + " failed to create, returns null" ) ; scaleCluster ( 2 , domain ) ; Assertions . assertTrue ( checkShutdownUpdatedProp ( domain . getDomainUid ( ) + "-managed-server1" , domain . getDomainNs ( ) , "Graceful" ) , domain . getDomainUid ( ) + "-managed-server1 :" + " shutdown properties don't not match the expected : " + "shutdownType=Graceful" ) ; Assertions . assertTrue ( checkShutdownUpdatedProp ( domain . getDomainUid ( ) + "-managed-server2" , domain . getDomainNs ( ) , "Forced" ) , domain . getDomainUid ( ) + "-managed-server2 :" + " shutdown properties don't not match the expected : " + "shutdownType=Forced" ) ; } finally { if ( domain != null ) { TestUtils . deleteWeblogicDomainResources ( domain . getDomainUid ( ) ) ; } } LoggerHelper . getLocal ( ) . log ( Level . INFO , "SUCCESS - {0}" , testMethodName ) ; }
Add shutdown options at cluster spec level and the managed server1 level,verify managed server
 override cluster level.
Add shutdown options at cluster spec level and the managed server1 level verify managed server override cluster level .
// scale up to 2 replicas to check both managed servers in the cluster