new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiMultiModel.java
@Test
  @DisplayName("Create a model-in-image domain with two model files in both the image and the ConfigMap")
  @Slow
  public void testMiiWithMultiModelImageAndCM() {
    final String adminServerPodName = String.format("%s-%s", domainUid3, ADMIN_SERVER_NAME_BASE);
    final String managedServerPrefix = String.format("%s-%s", domainUid3, MANAGED_SERVER_NAME_BASE);
    final String configMapName = "ds-multi-model-image-cm";
    final String expectedMaxCapacity = "40";
    final String expectedMaxCapacityDS3 = "5";

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

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

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

    createDomainResourceAndVerify(
        domainUid3,
        domainNamespace,
        adminServerPodName,
        managedServerPrefix, 
        miiImageMultiModel,
        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",
            domainUid3, domainNamespace, dsName, maxCapacityValue, expectedMaxCapacity));

    logger.info(String.format("Domain %s in namespace %s DataSource %s MaxCapacity is %s, as expected",
            domainUid3, 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",
            domainUid3, domainNamespace, dsName3, maxCapacityValue, expectedMaxCapacityDS3));

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

    logger.info("Check that DataSource {0} does not exist", dsName2);
    assertTrue(dsDoesNotExist(adminServerPodName, domainNamespace, dsName2),
        String.format("Domain %s in namespace %s DataSource %s should not exist",
            domainUid3, domainNamespace, dsName2));

    logger.info(String.format("Domain %s in namespace %s DataSource %s does not exist as expected",
            domainUid3, domainNamespace, dsName2));

  }
/**
   * Test that two WDT model files in a model-in-image image and two WDT model files in the domain
   * resource's ConfigMap are handled as expected.
   *
   * <p>Create a WebLogic domain using a model-in-image Docker image that contains two WDT model files,
   * and also using a ConfigMap that contains two more model files.
   * Verify that the effective configuration of the domain is as expected. Note that the model files
   * in the image are ordered independently from the model files in the domain's ConfigMap. </p>
   *
   * <p>The two model files in the Docker image define the same DataSource "TestDataSource" with 
   * the connection pool's MaxCapacity set to 15 and 20 respectively.
   * In addition, the first model defines a second DataSource "TestDataSource2", which is deleted by
   * the second model. When the two model files are applied, the resultant domain will only have
   * "TestDataSource" with MaxCapacity set to 20, and "TestDataSource2" should not exist. </p>
   *
   * <p>Then the two model files in the ConfigMap will be applied.
   * They define the same DataSource "TestDataSource" with MaxCapaqcity set to 30 and 40 respectively,
   * and, in addition, the first model defines another DataSource "TestDataSource3" with MaxCapacity
   * set to 5. </p>
   *
   * <p>According to the ordering rules, the effective domain should contain "TestDataSource" with 
   * MaxCapacity set to 40, "TestDataSource3" with MaxCapacity set to "5", and "TestDataSource2"
   * should not exist after all four model files are processed by the WebLogic Deploy Tooling. </p>
   */
Test that two WDT model files in a model-in-image image and two WDT model files in the domain
resource's ConfigMap are handled as expected.

Create a WebLogic domain using a model-in-image Docker image that contains two WDT model files,
and also using a ConfigMap that contains two more model files.
Verify that the effective configuration of the domain is as expected. Note that the model files
in the image are ordered independently from the model files in the domain's ConfigMap.

The two model files in the Docker image define the same DataSource "TestDataSource" with
the connection pool's MaxCapacity set to 15 and 20 respectively.
In addition, the first model defines a second DataSource "TestDataSource2", which is deleted by
the second model. When the two model files are applied, the resultant domain will only have
"TestDataSource" with MaxCapacity set to 20, and "TestDataSource2" should not exist.

Then the two model files in the ConfigMap will be applied.
They define the same DataSource "TestDataSource" with MaxCapaqcity set to 30 and 40 respectively,
and, in addition, the first model defines another DataSource "TestDataSource3" with MaxCapacity
set to 5.


Test that two WDT model files in a model - in - image image and two WDT model files in the domain resource ' s ConfigMap are handled as expected . Create a WebLogic domain using a model - in - image Docker image that contains two WDT model files and also using a ConfigMap that contains two more model files . Verify that the effective configuration of the domain is as expected . Note that the model files in the image are ordered independently from the model files in the domain ' s ConfigMap . The two model files in the Docker image define the same DataSource " TestDataSource " with the connection pool ' s MaxCapacity set to 15 and 20 respectively . In addition the first model defines a second DataSource " TestDataSource2 " which is deleted by the second model . When the two model files are applied the resultant domain will only have " TestDataSource " with MaxCapacity set to 20 and " TestDataSource2 " should not exist . Then the two model files in the ConfigMap will be applied . They define the same DataSource " TestDataSource " with MaxCapaqcity set to 30 and 40 respectively and in addition the first model defines another DataSource " TestDataSource3 " with MaxCapacity set to 5 .
@Test
  @DisplayName("Create a model-in-image domain with two model files in both the image and the ConfigMap")
  @Slow
  public void testMiiWithMultiModelImageAndCM() {
    final String adminServerPodName = String.format("%s-%s", domainUid3, ADMIN_SERVER_NAME_BASE);
    final String managedServerPrefix = String.format("%s-%s", domainUid3, MANAGED_SERVER_NAME_BASE);
    final String configMapName = "ds-multi-model-image-cm";
    final String expectedMaxCapacity = "40";
    final String expectedMaxCapacityDS3 = "5";
    logger.info("Create ConfigMap {0} in namespace {1} with WDT models {2} and {3}",
        configMapName, domainNamespace, modelFileName4, modelFileName3);
    List<String> modelFiles = Arrays.asList(modelFileName4, modelFileName3);
    createConfigMapAndVerify(
        configMapName, domainUid3, domainNamespace, modelFiles);
    logger.info("Create domain {0} in namespace {1} with image {2} and CM {3} that contains {4} and {5}",
        domainUid3, domainNamespace, miiImageMultiModel, configMapName, modelFileName4, modelFileName3);
    createDomainResourceAndVerify(
        domainUid3,
        domainNamespace,
        adminServerPodName,
        managedServerPrefix, 
        miiImageMultiModel,
        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",
            domainUid3, domainNamespace, dsName, maxCapacityValue, expectedMaxCapacity));
    logger.info(String.format("Domain %s in namespace %s DataSource %s MaxCapacity is %s, as expected",
            domainUid3, 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",
            domainUid3, domainNamespace, dsName3, maxCapacityValue, expectedMaxCapacityDS3));
    logger.info(String.format("Domain %s in namespace %s DataSource %s MaxCapacity is %s, as expected",
            domainUid3, domainNamespace, dsName3, expectedMaxCapacityDS3));
    logger.info("Check that DataSource {0} does not exist", dsName2);
    assertTrue(dsDoesNotExist(adminServerPodName, domainNamespace, dsName2),
        String.format("Domain %s in namespace %s DataSource %s should not exist",
            domainUid3, domainNamespace, dsName2));
    logger.info(String.format("Domain %s in namespace %s DataSource %s does not exist as expected",
            domainUid3, domainNamespace, dsName2));
  }
@ Test @ DisplayName ( "Create a model-in-image domain with two model files in both the image and the ConfigMap" ) @ Slow public void testMiiWithMultiModelImageAndCM ( ) { final String adminServerPodName = String . format ( "%s-%s" , domainUid3 , ADMIN_SERVER_NAME_BASE ) ; final String managedServerPrefix = String . format ( "%s-%s" , domainUid3 , MANAGED_SERVER_NAME_BASE ) ; final String configMapName = "ds-multi-model-image-cm" ; final String expectedMaxCapacity = "40" ; final String expectedMaxCapacityDS3 = "5" ; logger . info ( "Create ConfigMap {0} in namespace {1} with WDT models {2} and {3}" , configMapName , domainNamespace , modelFileName4 , modelFileName3 ) ; List < String > modelFiles = Arrays . asList ( modelFileName4 , modelFileName3 ) ; createConfigMapAndVerify ( configMapName , domainUid3 , domainNamespace , modelFiles ) ; logger . info ( "Create domain {0} in namespace {1} with image {2} and CM {3} that contains {4} and {5}" , domainUid3 , domainNamespace , miiImageMultiModel , configMapName , modelFileName4 , modelFileName3 ) ; createDomainResourceAndVerify ( domainUid3 , domainNamespace , adminServerPodName , managedServerPrefix , miiImageMultiModel , 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" , domainUid3 , domainNamespace , dsName , maxCapacityValue , expectedMaxCapacity ) ) ; logger . info ( String . format ( "Domain %s in namespace %s DataSource %s MaxCapacity is %s, as expected" , domainUid3 , 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" , domainUid3 , domainNamespace , dsName3 , maxCapacityValue , expectedMaxCapacityDS3 ) ) ; logger . info ( String . format ( "Domain %s in namespace %s DataSource %s MaxCapacity is %s, as expected" , domainUid3 , domainNamespace , dsName3 , expectedMaxCapacityDS3 ) ) ; logger . info ( "Check that DataSource {0} does not exist" , dsName2 ) ; assertTrue ( dsDoesNotExist ( adminServerPodName , domainNamespace , dsName2 ) , String . format ( "Domain %s in namespace %s DataSource %s should not exist" , domainUid3 , domainNamespace , dsName2 ) ) ; logger . info ( String . format ( "Domain %s in namespace %s DataSource %s does not exist as expected" , domainUid3 , domainNamespace , dsName2 ) ) ; }
Test that two WDT model files in a model-in-image image and two WDT model files in the domain
 resource's ConfigMap are handled as expected.
Test that two WDT model files in a model - in - image image and two WDT model files in the domain resource ' s ConfigMap are handled as expected .