new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiSample.java
@BeforeAll
  public static void initAll(@Namespaces(5) List<String> namespaces) {
    logger = getLogger();
    // get a new unique opNamespace
    logger.info("Creating unique namespace for Operator");
    assertNotNull(namespaces.get(0), "Namespace list is null");
    opNamespace = namespaces.get(0);

    logger.info("Creating unique namespace for Domain");
    assertNotNull(namespaces.get(1), "Namespace list is null");
    domainNamespace = namespaces.get(1);

    logger.info("Creating unique namespace for Traefik");
    assertNotNull(namespaces.get(2), "Namespace list is null");
    traefikNamespace = namespaces.get(2);

    logger.info("Creating unique namespace for Database");
    assertNotNull(namespaces.get(3), "Namespace list is null");
    dbNamespace = namespaces.get(3);

    // install and verify operator
    installAndVerifyOperator(opNamespace, domainNamespace);

    // env variables to override default values in sample scripts
    envMap = new HashMap<String, String>();
    envMap.put("DOMAIN_NAMESPACE", domainNamespace);
    envMap.put("TRAEFIK_NAMESPACE", traefikNamespace);
    envMap.put("TRAEFIK_HTTP_NODEPORT", "0"); // 0-->dynamically choose the np
    envMap.put("TRAEFIK_HTTPS_NODEPORT", "0"); // 0-->dynamically choose the np
    envMap.put("WORKDIR", MII_SAMPLES_WORK_DIR);
    envMap.put("IMAGE_PULL_SECRET_NAME", REPO_SECRET_NAME); //ocir secret
    envMap.put("K8S_NODEPORT_HOST", K8S_NODEPORT_HOST);

    // kind cluster uses openjdk which is not supported by image tool
    String witJavaHome = System.getenv("WIT_JAVA_HOME");
    if (witJavaHome != null) {
      envMap.put("JAVA_HOME", witJavaHome);
    }

    String witInstallerUrl = System.getProperty("wit.download.url");
    if (witInstallerUrl != null) {
      envMap.put("WIT_INSTALLER_URL", witInstallerUrl);
    }

    String wdtInstallerUrl = System.getProperty("wdt.download.url");
    if (wdtInstallerUrl != null) {
      envMap.put("WDT_INSTALLER_URL", wdtInstallerUrl);
    }

    logger.info("Env. variables to the script {0}", envMap);

    // install traefik using the mii sample script
    execTestScriptAndAssertSuccess("-traefik", "Traefik deployment failure");

    logger.info("Setting up docker secrets");

    // Create the repo secret to pull the image
    assertDoesNotThrow(() -> createDockerRegistrySecret(REPO_USERNAME, REPO_PASSWORD, REPO_EMAIL,
        REPO_REGISTRY, REPO_SECRET_NAME, domainNamespace),
        String.format("createSecret failed for %s", REPO_SECRET_NAME));
    logger.info("Docker registry secret {0} created successfully in namespace {1}",
        REPO_SECRET_NAME, domainNamespace);

    // create ocr docker registry secret to pull the db images
    assertDoesNotThrow(() -> createDockerRegistrySecret(OCR_USERNAME, OCR_PASSWORD,
        OCR_EMAIL, OCR_REGISTRY, OCR_SECRET_NAME, dbNamespace),
        String.format("createSecret failed for %s", OCR_SECRET_NAME));
    logger.info("Docker registry secret {0} created successfully in namespace {1}",
        OCR_SECRET_NAME, dbNamespace);
  }
/**
   * Install Operator.
   * @param namespaces list of namespaces created by the IntegrationTestWatcher by the
   *        JUnit engine parameter resolution mechanism
   */
Install Operator.
@param namespaces list of namespaces created by the IntegrationTestWatcher by the
JUnit engine parameter resolution mechanism
Install Operator . @param namespaces list of namespaces created by the IntegrationTestWatcher by the JUnit engine parameter resolution mechanism
@BeforeAll
  public static void initAll(@Namespaces(5) List<String> namespaces) {
    logger = getLogger();
    logger.info("Creating unique namespace for Operator");
    assertNotNull(namespaces.get(0), "Namespace list is null");
    opNamespace = namespaces.get(0);
    logger.info("Creating unique namespace for Domain");
    assertNotNull(namespaces.get(1), "Namespace list is null");
    domainNamespace = namespaces.get(1);
    logger.info("Creating unique namespace for Traefik");
    assertNotNull(namespaces.get(2), "Namespace list is null");
    traefikNamespace = namespaces.get(2);
    logger.info("Creating unique namespace for Database");
    assertNotNull(namespaces.get(3), "Namespace list is null");
    dbNamespace = namespaces.get(3);
    installAndVerifyOperator(opNamespace, domainNamespace);
    envMap = new HashMap<String, String>();
    envMap.put("DOMAIN_NAMESPACE", domainNamespace);
    envMap.put("TRAEFIK_NAMESPACE", traefikNamespace);
    envMap.put("TRAEFIK_HTTP_NODEPORT", "0"); 
    envMap.put("TRAEFIK_HTTPS_NODEPORT", "0"); 
    envMap.put("WORKDIR", MII_SAMPLES_WORK_DIR);
    envMap.put("IMAGE_PULL_SECRET_NAME", REPO_SECRET_NAME); 
    envMap.put("K8S_NODEPORT_HOST", K8S_NODEPORT_HOST);
    String witJavaHome = System.getenv("WIT_JAVA_HOME");
    if (witJavaHome != null) {
      envMap.put("JAVA_HOME", witJavaHome);
    }
    String witInstallerUrl = System.getProperty("wit.download.url");
    if (witInstallerUrl != null) {
      envMap.put("WIT_INSTALLER_URL", witInstallerUrl);
    }
    String wdtInstallerUrl = System.getProperty("wdt.download.url");
    if (wdtInstallerUrl != null) {
      envMap.put("WDT_INSTALLER_URL", wdtInstallerUrl);
    }
    logger.info("Env. variables to the script {0}", envMap);
    execTestScriptAndAssertSuccess("-traefik", "Traefik deployment failure");
    logger.info("Setting up docker secrets");
    assertDoesNotThrow(() -> createDockerRegistrySecret(REPO_USERNAME, REPO_PASSWORD, REPO_EMAIL,
        REPO_REGISTRY, REPO_SECRET_NAME, domainNamespace),
        String.format("createSecret failed for %s", REPO_SECRET_NAME));
    logger.info("Docker registry secret {0} created successfully in namespace {1}",
        REPO_SECRET_NAME, domainNamespace);
    assertDoesNotThrow(() -> createDockerRegistrySecret(OCR_USERNAME, OCR_PASSWORD,
        OCR_EMAIL, OCR_REGISTRY, OCR_SECRET_NAME, dbNamespace),
        String.format("createSecret failed for %s", OCR_SECRET_NAME));
    logger.info("Docker registry secret {0} created successfully in namespace {1}",
        OCR_SECRET_NAME, dbNamespace);
  }
@ BeforeAll public static void initAll ( @ Namespaces ( 5 ) List < String > namespaces ) { logger = getLogger ( ) ; logger . info ( "Creating unique namespace for Operator" ) ; assertNotNull ( namespaces . get ( 0 ) , "Namespace list is null" ) ; opNamespace = namespaces . get ( 0 ) ; logger . info ( "Creating unique namespace for Domain" ) ; assertNotNull ( namespaces . get ( 1 ) , "Namespace list is null" ) ; domainNamespace = namespaces . get ( 1 ) ; logger . info ( "Creating unique namespace for Traefik" ) ; assertNotNull ( namespaces . get ( 2 ) , "Namespace list is null" ) ; traefikNamespace = namespaces . get ( 2 ) ; logger . info ( "Creating unique namespace for Database" ) ; assertNotNull ( namespaces . get ( 3 ) , "Namespace list is null" ) ; dbNamespace = namespaces . get ( 3 ) ; installAndVerifyOperator ( opNamespace , domainNamespace ) ; envMap = new HashMap < String , String > ( ) ; envMap . put ( "DOMAIN_NAMESPACE" , domainNamespace ) ; envMap . put ( "TRAEFIK_NAMESPACE" , traefikNamespace ) ; envMap . put ( "TRAEFIK_HTTP_NODEPORT" , "0" ) ; envMap . put ( "TRAEFIK_HTTPS_NODEPORT" , "0" ) ; envMap . put ( "WORKDIR" , MII_SAMPLES_WORK_DIR ) ; envMap . put ( "IMAGE_PULL_SECRET_NAME" , REPO_SECRET_NAME ) ; envMap . put ( "K8S_NODEPORT_HOST" , K8S_NODEPORT_HOST ) ; String witJavaHome = System . getenv ( "WIT_JAVA_HOME" ) ; if ( witJavaHome != null ) { envMap . put ( "JAVA_HOME" , witJavaHome ) ; } String witInstallerUrl = System . getProperty ( "wit.download.url" ) ; if ( witInstallerUrl != null ) { envMap . put ( "WIT_INSTALLER_URL" , witInstallerUrl ) ; } String wdtInstallerUrl = System . getProperty ( "wdt.download.url" ) ; if ( wdtInstallerUrl != null ) { envMap . put ( "WDT_INSTALLER_URL" , wdtInstallerUrl ) ; } logger . info ( "Env. variables to the script {0}" , envMap ) ; execTestScriptAndAssertSuccess ( "-traefik" , "Traefik deployment failure" ) ; logger . info ( "Setting up docker secrets" ) ; assertDoesNotThrow ( ( ) -> createDockerRegistrySecret ( REPO_USERNAME , REPO_PASSWORD , REPO_EMAIL , REPO_REGISTRY , REPO_SECRET_NAME , domainNamespace ) , String . format ( "createSecret failed for %s" , REPO_SECRET_NAME ) ) ; logger . info ( "Docker registry secret {0} created successfully in namespace {1}" , REPO_SECRET_NAME , domainNamespace ) ; assertDoesNotThrow ( ( ) -> createDockerRegistrySecret ( OCR_USERNAME , OCR_PASSWORD , OCR_EMAIL , OCR_REGISTRY , OCR_SECRET_NAME , dbNamespace ) , String . format ( "createSecret failed for %s" , OCR_SECRET_NAME ) ) ; logger . info ( "Docker registry secret {0} created successfully in namespace {1}" , OCR_SECRET_NAME , dbNamespace ) ; }
Install Operator.
Install Operator .
// get a new unique opNamespace // install and verify operator // env variables to override default values in sample scripts // 0-->dynamically choose the np // 0-->dynamically choose the np //ocir secret // kind cluster uses openjdk which is not supported by image tool // install traefik using the mii sample script // Create the repo secret to pull the image // create ocr docker registry secret to pull the db images