new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItDomainInImageWdt.java
@Test
  @DisplayName("Create domain in image domain using WDT")
  @Slow
  @MustNotRunInParallel
  public void testCreateDomaininImageWdt() {
    // admin/managed server name here should match with model yaml in WDT_MODEL_FILE
    final String adminServerPodName = domainUid + "-admin-server";
    final String managedServerPrefix = domainUid + "-managed-server";
    final int replicaCount = 2;

    // Create the repo secret to pull the image
    createDockerRegistrySecret(domainNamespace);

    // create secret for admin credentials
    logger.info("Create secret for admin credentials");
    String adminSecretName = "weblogic-credentials";
    createSecretWithUsernamePassword(adminSecretName, domainNamespace, ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT);

    // create the domain CR
    createDomainResource(domainUid, domainNamespace, adminSecretName, REPO_SECRET_NAME,
        replicaCount);

    // wait for the domain to exist
    logger.info("Check for domain custom resource in namespace {0}", domainNamespace);
    withStandardRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for domain {0} to be created in namespace {1} "
                    + "(elapsed time {2}ms, remaining time {3}ms)",
                domainUid,
                domainNamespace,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(domainExists(domainUid, DOMAIN_VERSION, domainNamespace));


    // check admin server pod exists
    logger.info("Check for admin server pod {0} existence in namespace {1}",
        adminServerPodName, domainNamespace);
    checkPodExists(adminServerPodName, domainUid, domainNamespace);

    // check managed server pods exist
    for (int i = 1; i <= replicaCount; i++) {
      logger.info("Check for managed server pod {0} existence in namespace {1}",
          managedServerPrefix + i, domainNamespace);
      checkPodExists(managedServerPrefix + i, domainUid, domainNamespace);
    }

    // check admin server pod is ready
    logger.info("Wait for admin server pod {0} to be ready in namespace {1}",
        adminServerPodName, domainNamespace);
    checkPodReady(adminServerPodName, domainUid, domainNamespace);

    // check managed server pods are ready
    for (int i = 1; i <= replicaCount; i++) {
      logger.info("Wait for managed server pod {0} to be ready in namespace {1}",
          managedServerPrefix + i, domainNamespace);
      checkPodReady(managedServerPrefix + i, domainUid, domainNamespace);
    }

    logger.info("Check admin service {0} is created in namespace {1}",
        adminServerPodName, domainNamespace);
    checkServiceExists(adminServerPodName, domainNamespace);

    // check managed server services created
    for (int i = 1; i <= replicaCount; i++) {
      logger.info("Check managed server service {0} is created in namespace {1}",
          managedServerPrefix + i, domainNamespace);
      checkServiceExists(managedServerPrefix + i, domainNamespace);
    }

    logger.info("Getting node port");
    int serviceNodePort = assertDoesNotThrow(()
        -> getServiceNodePort(domainNamespace, adminServerPodName + "-external", "default"),
        "Getting admin server node port failed");

    logger.info("Validating WebLogic admin server access by login to console");
    boolean loginSuccessful = assertDoesNotThrow(() -> {
      return TestAssertions.adminNodePortAccessible(serviceNodePort, ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT);
    }, "Access to admin server node port failed");
    assertTrue(loginSuccessful, "Console login validation failed");

  }
/**
   * create a domain in image domain and verify domain creation by checking pod
   * ready/running and service exists.
   */
create a domain in image domain and verify domain creation by checking pod
ready/running and service exists.
create a domain in image domain and verify domain creation by checking pod ready / running and service exists .
@Test
  @DisplayName("Create domain in image domain using WDT")
  @Slow
  @MustNotRunInParallel
  public void testCreateDomaininImageWdt() {
    final String adminServerPodName = domainUid + "-admin-server";
    final String managedServerPrefix = domainUid + "-managed-server";
    final int replicaCount = 2;
    createDockerRegistrySecret(domainNamespace);
    logger.info("Create secret for admin credentials");
    String adminSecretName = "weblogic-credentials";
    createSecretWithUsernamePassword(adminSecretName, domainNamespace, ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT);
    createDomainResource(domainUid, domainNamespace, adminSecretName, REPO_SECRET_NAME,
        replicaCount);
    logger.info("Check for domain custom resource in namespace {0}", domainNamespace);
    withStandardRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for domain {0} to be created in namespace {1} "
                    + "(elapsed time {2}ms, remaining time {3}ms)",
                domainUid,
                domainNamespace,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(domainExists(domainUid, DOMAIN_VERSION, domainNamespace));
    logger.info("Check for admin server pod {0} existence in namespace {1}",
        adminServerPodName, domainNamespace);
    checkPodExists(adminServerPodName, domainUid, domainNamespace);
    for (int i = 1; i <= replicaCount; i++) {
      logger.info("Check for managed server pod {0} existence in namespace {1}",
          managedServerPrefix + i, domainNamespace);
      checkPodExists(managedServerPrefix + i, domainUid, domainNamespace);
    }
    logger.info("Wait for admin server pod {0} to be ready in namespace {1}",
        adminServerPodName, domainNamespace);
    checkPodReady(adminServerPodName, domainUid, domainNamespace);
    for (int i = 1; i <= replicaCount; i++) {
      logger.info("Wait for managed server pod {0} to be ready in namespace {1}",
          managedServerPrefix + i, domainNamespace);
      checkPodReady(managedServerPrefix + i, domainUid, domainNamespace);
    }
    logger.info("Check admin service {0} is created in namespace {1}",
        adminServerPodName, domainNamespace);
    checkServiceExists(adminServerPodName, domainNamespace);
    for (int i = 1; i <= replicaCount; i++) {
      logger.info("Check managed server service {0} is created in namespace {1}",
          managedServerPrefix + i, domainNamespace);
      checkServiceExists(managedServerPrefix + i, domainNamespace);
    }
    logger.info("Getting node port");
    int serviceNodePort = assertDoesNotThrow(()
        -> getServiceNodePort(domainNamespace, adminServerPodName + "-external", "default"),
        "Getting admin server node port failed");
    logger.info("Validating WebLogic admin server access by login to console");
    boolean loginSuccessful = assertDoesNotThrow(() -> {
      return TestAssertions.adminNodePortAccessible(serviceNodePort, ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT);
    }, "Access to admin server node port failed");
    assertTrue(loginSuccessful, "Console login validation failed");
  }
@ Test @ DisplayName ( "Create domain in image domain using WDT" ) @ Slow @ MustNotRunInParallel public void testCreateDomaininImageWdt ( ) { final String adminServerPodName = domainUid + "-admin-server" ; final String managedServerPrefix = domainUid + "-managed-server" ; final int replicaCount = 2 ; createDockerRegistrySecret ( domainNamespace ) ; logger . info ( "Create secret for admin credentials" ) ; String adminSecretName = "weblogic-credentials" ; createSecretWithUsernamePassword ( adminSecretName , domainNamespace , ADMIN_USERNAME_DEFAULT , ADMIN_PASSWORD_DEFAULT ) ; createDomainResource ( domainUid , domainNamespace , adminSecretName , REPO_SECRET_NAME , replicaCount ) ; logger . info ( "Check for domain custom resource in namespace {0}" , domainNamespace ) ; withStandardRetryPolicy . conditionEvaluationListener ( condition -> logger . info ( "Waiting for domain {0} to be created in namespace {1} " + "(elapsed time {2}ms, remaining time {3}ms)" , domainUid , domainNamespace , condition . getElapsedTimeInMS ( ) , condition . getRemainingTimeInMS ( ) ) ) . until ( domainExists ( domainUid , DOMAIN_VERSION , domainNamespace ) ) ; logger . info ( "Check for admin server pod {0} existence in namespace {1}" , adminServerPodName , domainNamespace ) ; checkPodExists ( adminServerPodName , domainUid , domainNamespace ) ; for ( int i = 1 ; i <= replicaCount ; i ++ ) { logger . info ( "Check for managed server pod {0} existence in namespace {1}" , managedServerPrefix + i , domainNamespace ) ; checkPodExists ( managedServerPrefix + i , domainUid , domainNamespace ) ; } logger . info ( "Wait for admin server pod {0} to be ready in namespace {1}" , adminServerPodName , domainNamespace ) ; checkPodReady ( adminServerPodName , domainUid , domainNamespace ) ; for ( int i = 1 ; i <= replicaCount ; i ++ ) { logger . info ( "Wait for managed server pod {0} to be ready in namespace {1}" , managedServerPrefix + i , domainNamespace ) ; checkPodReady ( managedServerPrefix + i , domainUid , domainNamespace ) ; } logger . info ( "Check admin service {0} is created in namespace {1}" , adminServerPodName , domainNamespace ) ; checkServiceExists ( adminServerPodName , domainNamespace ) ; for ( int i = 1 ; i <= replicaCount ; i ++ ) { logger . info ( "Check managed server service {0} is created in namespace {1}" , managedServerPrefix + i , domainNamespace ) ; checkServiceExists ( managedServerPrefix + i , domainNamespace ) ; } logger . info ( "Getting node port" ) ; int serviceNodePort = assertDoesNotThrow ( ( ) -> getServiceNodePort ( domainNamespace , adminServerPodName + "-external" , "default" ) , "Getting admin server node port failed" ) ; logger . info ( "Validating WebLogic admin server access by login to console" ) ; boolean loginSuccessful = assertDoesNotThrow ( ( ) -> { return TestAssertions . adminNodePortAccessible ( serviceNodePort , ADMIN_USERNAME_DEFAULT , ADMIN_PASSWORD_DEFAULT ) ; } , "Access to admin server node port failed" ) ; assertTrue ( loginSuccessful , "Console login validation failed" ) ; }
create a domain in image domain and verify domain creation by checking pod
 ready/running and service exists.
create a domain in image domain and verify domain creation by checking pod ready / running and service exists .
// admin/managed server name here should match with model yaml in WDT_MODEL_FILE // Create the repo secret to pull the image // create secret for admin credentials // create the domain CR // wait for the domain to exist // check admin server pod exists // check managed server pods exist // check admin server pod is ready // check managed server pods are ready // check managed server services created