new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiMultiModel.java
@Test
  @DisplayName("Create model-in-image domain with a ConfigMap that contains multiple model files")
  @Slow
  public void testMiiWithMultiModelCM() {
    final String adminServerPodName = String.format("%s-%s", domainUid1, ADMIN_SERVER_NAME_BASE);
    final String managedServerPrefix = String.format("%s-%s", domainUid1, MANAGED_SERVER_NAME_BASE);
    final String expectedMaxCapacity = "40";
    final String expectedMaxCapacityDS3 = "5";

    final String configMapName = "ds-multi-model-cm";

    logger.info("Create ConfigMap {0} in namespace {1} with WDT models {3} and {4}",
        configMapName, domainNamespace, modelFileName3, modelFileName4);

    List<String> modelFiles = Arrays.asList(modelFileName3, modelFileName4);
    createConfigMapAndVerify(
        configMapName, domainUid1, domainNamespace, modelFiles);

    logger.info("Create domain {0} in namespace {1} with CM {2} that contains WDT models {3} and {4}",
        domainUid1, domainNamespace, configMapName, modelFileName3, modelFileName4);

    createDomainResourceAndVerify(
        domainUid1,
        domainNamespace,
        adminServerPodName,
        managedServerPrefix, 
        MII_BASIC_IMAGE_NAME + ":" + MII_BASIC_IMAGE_TAG,
        configMapName);

    logger.info("Check the MaxCapacity setting of DataSource {0}", dsName);
    String maxCapacityValue = getDSMaxCapacity(adminServerPodName, domainNamespace, dsName);
    assertEquals(expectedMaxCapacity, maxCapacityValue, 
        String.format("Domain %s in namespace %s DataSource %s MaxCapacity is %s, instead of %s",
            domainUid1, domainNamespace, dsName, maxCapacityValue, expectedMaxCapacity));

    logger.info(String.format("Domain %s in namespace %s DataSource %s MaxCapacity is %s, as expected",
            domainUid1, domainNamespace, dsName, expectedMaxCapacity));

    logger.info("Check the MaxCapacity setting of DataSource {0}", dsName3);
    maxCapacityValue = getDSMaxCapacity(adminServerPodName, domainNamespace, dsName3);
    assertEquals(expectedMaxCapacityDS3, maxCapacityValue, 
        String.format("Domain %s in namespace %s DataSource %s MaxCapacity is %s, instead of %s",
            domainUid1, domainNamespace, dsName3, maxCapacityValue, expectedMaxCapacityDS3));

    logger.info(String.format("Domain %s in namespace %s DataSource %s MaxCapacity is %s, as expected",
            domainUid1, domainNamespace, dsName3, expectedMaxCapacityDS3));

  }
/**
   * Test that two WDT model files in a domain resource's ConfigMap are applied in the expected order.
   *
   * <p>Create a WebLogic domain with a Kubernetes ConfigMap that contains two WDT model files.
   * Verify that the effective configuration of the domain is as expected. </p>
   *
   * <p>The two model files specify the same DataSource "TestDataSource" with the connection pool's
   * MaxCapacity set to 30 and 40 respectively. In addition, the first model file also 
   * specifies a second DataSource "TestDataSource3" with the maxCapacity set to 5. </p>
   *
   * <p>According to the ordering rules, the resultant configuration should have two DataSources,
   * "TestDataSource" and "TestDataSource3", with the MaxCapacity set to 40 and 5 respectively. </p>
   */
Test that two WDT model files in a domain resource's ConfigMap are applied in the expected order.
Create a WebLogic domain with a Kubernetes ConfigMap that contains two WDT model files.
Verify that the effective configuration of the domain is as expected.

The two model files specify the same DataSource "TestDataSource" with the connection pool's
MaxCapacity set to 30 and 40 respectively. In addition, the first model file also
specifies a second DataSource "TestDataSource3" with the maxCapacity set to 5.

According to the ordering rules, the resultant configuration should have two DataSources,
"TestDataSource" and "TestDataSource3", with the MaxCapacity set to 40 and 5 respectively.
Test that two WDT model files in a domain resource ' s ConfigMap are applied in the expected order . Create a WebLogic domain with a Kubernetes ConfigMap that contains two WDT model files . Verify that the effective configuration of the domain is as expected . The two model files specify the same DataSource " TestDataSource " with the connection pool ' s MaxCapacity set to 30 and 40 respectively . In addition the first model file also specifies a second DataSource " TestDataSource3 " with the maxCapacity set to 5 . According to the ordering rules the resultant configuration should have two DataSources " TestDataSource " and " TestDataSource3 " with the MaxCapacity set to 40 and 5 respectively .
@Test
  @DisplayName("Create model-in-image domain with a ConfigMap that contains multiple model files")
  @Slow
  public void testMiiWithMultiModelCM() {
    final String adminServerPodName = String.format("%s-%s", domainUid1, ADMIN_SERVER_NAME_BASE);
    final String managedServerPrefix = String.format("%s-%s", domainUid1, MANAGED_SERVER_NAME_BASE);
    final String expectedMaxCapacity = "40";
    final String expectedMaxCapacityDS3 = "5";
    final String configMapName = "ds-multi-model-cm";
    logger.info("Create ConfigMap {0} in namespace {1} with WDT models {3} and {4}",
        configMapName, domainNamespace, modelFileName3, modelFileName4);
    List<String> modelFiles = Arrays.asList(modelFileName3, modelFileName4);
    createConfigMapAndVerify(
        configMapName, domainUid1, domainNamespace, modelFiles);
    logger.info("Create domain {0} in namespace {1} with CM {2} that contains WDT models {3} and {4}",
        domainUid1, domainNamespace, configMapName, modelFileName3, modelFileName4);
    createDomainResourceAndVerify(
        domainUid1,
        domainNamespace,
        adminServerPodName,
        managedServerPrefix, 
        MII_BASIC_IMAGE_NAME + ":" + MII_BASIC_IMAGE_TAG,
        configMapName);
    logger.info("Check the MaxCapacity setting of DataSource {0}", dsName);
    String maxCapacityValue = getDSMaxCapacity(adminServerPodName, domainNamespace, dsName);
    assertEquals(expectedMaxCapacity, maxCapacityValue, 
        String.format("Domain %s in namespace %s DataSource %s MaxCapacity is %s, instead of %s",
            domainUid1, domainNamespace, dsName, maxCapacityValue, expectedMaxCapacity));
    logger.info(String.format("Domain %s in namespace %s DataSource %s MaxCapacity is %s, as expected",
            domainUid1, domainNamespace, dsName, expectedMaxCapacity));
    logger.info("Check the MaxCapacity setting of DataSource {0}", dsName3);
    maxCapacityValue = getDSMaxCapacity(adminServerPodName, domainNamespace, dsName3);
    assertEquals(expectedMaxCapacityDS3, maxCapacityValue, 
        String.format("Domain %s in namespace %s DataSource %s MaxCapacity is %s, instead of %s",
            domainUid1, domainNamespace, dsName3, maxCapacityValue, expectedMaxCapacityDS3));
    logger.info(String.format("Domain %s in namespace %s DataSource %s MaxCapacity is %s, as expected",
            domainUid1, domainNamespace, dsName3, expectedMaxCapacityDS3));
  }
@ Test @ DisplayName ( "Create model-in-image domain with a ConfigMap that contains multiple model files" ) @ Slow public void testMiiWithMultiModelCM ( ) { final String adminServerPodName = String . format ( "%s-%s" , domainUid1 , ADMIN_SERVER_NAME_BASE ) ; final String managedServerPrefix = String . format ( "%s-%s" , domainUid1 , MANAGED_SERVER_NAME_BASE ) ; final String expectedMaxCapacity = "40" ; final String expectedMaxCapacityDS3 = "5" ; final String configMapName = "ds-multi-model-cm" ; logger . info ( "Create ConfigMap {0} in namespace {1} with WDT models {3} and {4}" , configMapName , domainNamespace , modelFileName3 , modelFileName4 ) ; List < String > modelFiles = Arrays . asList ( modelFileName3 , modelFileName4 ) ; createConfigMapAndVerify ( configMapName , domainUid1 , domainNamespace , modelFiles ) ; logger . info ( "Create domain {0} in namespace {1} with CM {2} that contains WDT models {3} and {4}" , domainUid1 , domainNamespace , configMapName , modelFileName3 , modelFileName4 ) ; createDomainResourceAndVerify ( domainUid1 , domainNamespace , adminServerPodName , managedServerPrefix , MII_BASIC_IMAGE_NAME + ":" + MII_BASIC_IMAGE_TAG , configMapName ) ; logger . info ( "Check the MaxCapacity setting of DataSource {0}" , dsName ) ; String maxCapacityValue = getDSMaxCapacity ( adminServerPodName , domainNamespace , dsName ) ; assertEquals ( expectedMaxCapacity , maxCapacityValue , String . format ( "Domain %s in namespace %s DataSource %s MaxCapacity is %s, instead of %s" , domainUid1 , domainNamespace , dsName , maxCapacityValue , expectedMaxCapacity ) ) ; logger . info ( String . format ( "Domain %s in namespace %s DataSource %s MaxCapacity is %s, as expected" , domainUid1 , domainNamespace , dsName , expectedMaxCapacity ) ) ; logger . info ( "Check the MaxCapacity setting of DataSource {0}" , dsName3 ) ; maxCapacityValue = getDSMaxCapacity ( adminServerPodName , domainNamespace , dsName3 ) ; assertEquals ( expectedMaxCapacityDS3 , maxCapacityValue , String . format ( "Domain %s in namespace %s DataSource %s MaxCapacity is %s, instead of %s" , domainUid1 , domainNamespace , dsName3 , maxCapacityValue , expectedMaxCapacityDS3 ) ) ; logger . info ( String . format ( "Domain %s in namespace %s DataSource %s MaxCapacity is %s, as expected" , domainUid1 , domainNamespace , dsName3 , expectedMaxCapacityDS3 ) ) ; }
Test that two WDT model files in a domain resource's ConfigMap are applied in the expected order.
Test that two WDT model files in a domain resource ' s ConfigMap are applied in the expected order .