new-integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonMiiTestUtils.java
public static void createMiiDomainAndVerify(
      String domainNamespace,
      String domainUid,
      String imageName,
      String adminServerPodName,
      String managedServerPrefix,
      int replicaCount
  ) {
    LoggingFacade logger = getLogger();
    logger.info("Create the repo secret {0} to pull the image", REPO_SECRET_NAME);
    assertDoesNotThrow(() -> createDockerRegistrySecret(domainNamespace),
            String.format("createSecret failed for %s", REPO_SECRET_NAME));

    // create secret for admin credentials
    logger.info("Create secret for admin credentials");
    String adminSecretName = "weblogic-credentials";
    assertDoesNotThrow(() -> createSecretWithUsernamePassword(
        adminSecretName,
        domainNamespace,
        ADMIN_USERNAME_DEFAULT,
        ADMIN_PASSWORD_DEFAULT),
        String.format("createSecret failed for %s", adminSecretName));

    // create encryption secret
    logger.info("Create encryption secret");
    String encryptionSecretName = "encryptionsecret";
    assertDoesNotThrow(() -> createSecretWithUsernamePassword(
        encryptionSecretName,
        domainNamespace,
        "weblogicenc",
        "weblogicenc"),
        String.format("createSecret failed for %s", encryptionSecretName));

    // create the domain custom resource
    logger.info("Create domain resource {0} object in namespace {1} and verify that it is created",
        domainUid, domainNamespace);
    Domain domain = createDomainResource(
        domainUid,
        domainNamespace,
        imageName,
        adminSecretName,
        REPO_SECRET_NAME,
        encryptionSecretName,
        replicaCount);

    createDomainAndVerify(domain, 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);
    }
  }
/**
   * Create a basic Kubernetes domain resource and wait until the domain is fully up.
   *
   * @param domainNamespace Kubernetes namespace that the pod is running in
   * @param domainUid identifier of the domain
   * @param imageName name of the image including its tag
   * @param adminServerPodName name of the admin server pod
   * @param managedServerPrefix prefix of the managed server pods
   * @param replicaCount number of managed servers to start
   */
Create a basic Kubernetes domain resource and wait until the domain is fully up.
Create a basic Kubernetes domain resource and wait until the domain is fully up .
public static void createMiiDomainAndVerify(
      String domainNamespace,
      String domainUid,
      String imageName,
      String adminServerPodName,
      String managedServerPrefix,
      int replicaCount
  ) {
    LoggingFacade logger = getLogger();
    logger.info("Create the repo secret {0} to pull the image", REPO_SECRET_NAME);
    assertDoesNotThrow(() -> createDockerRegistrySecret(domainNamespace),
            String.format("createSecret failed for %s", REPO_SECRET_NAME));
    logger.info("Create secret for admin credentials");
    String adminSecretName = "weblogic-credentials";
    assertDoesNotThrow(() -> createSecretWithUsernamePassword(
        adminSecretName,
        domainNamespace,
        ADMIN_USERNAME_DEFAULT,
        ADMIN_PASSWORD_DEFAULT),
        String.format("createSecret failed for %s", adminSecretName));
    logger.info("Create encryption secret");
    String encryptionSecretName = "encryptionsecret";
    assertDoesNotThrow(() -> createSecretWithUsernamePassword(
        encryptionSecretName,
        domainNamespace,
        "weblogicenc",
        "weblogicenc"),
        String.format("createSecret failed for %s", encryptionSecretName));
    logger.info("Create domain resource {0} object in namespace {1} and verify that it is created",
        domainUid, domainNamespace);
    Domain domain = createDomainResource(
        domainUid,
        domainNamespace,
        imageName,
        adminSecretName,
        REPO_SECRET_NAME,
        encryptionSecretName,
        replicaCount);
    createDomainAndVerify(domain, 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);
    }
  }
public static void createMiiDomainAndVerify ( String domainNamespace , String domainUid , String imageName , String adminServerPodName , String managedServerPrefix , int replicaCount ) { LoggingFacade logger = getLogger ( ) ; logger . info ( "Create the repo secret {0} to pull the image" , REPO_SECRET_NAME ) ; assertDoesNotThrow ( ( ) -> createDockerRegistrySecret ( domainNamespace ) , String . format ( "createSecret failed for %s" , REPO_SECRET_NAME ) ) ; logger . info ( "Create secret for admin credentials" ) ; String adminSecretName = "weblogic-credentials" ; assertDoesNotThrow ( ( ) -> createSecretWithUsernamePassword ( adminSecretName , domainNamespace , ADMIN_USERNAME_DEFAULT , ADMIN_PASSWORD_DEFAULT ) , String . format ( "createSecret failed for %s" , adminSecretName ) ) ; logger . info ( "Create encryption secret" ) ; String encryptionSecretName = "encryptionsecret" ; assertDoesNotThrow ( ( ) -> createSecretWithUsernamePassword ( encryptionSecretName , domainNamespace , "weblogicenc" , "weblogicenc" ) , String . format ( "createSecret failed for %s" , encryptionSecretName ) ) ; logger . info ( "Create domain resource {0} object in namespace {1} and verify that it is created" , domainUid , domainNamespace ) ; Domain domain = createDomainResource ( domainUid , domainNamespace , imageName , adminSecretName , REPO_SECRET_NAME , encryptionSecretName , replicaCount ) ; createDomainAndVerify ( domain , 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 ) ; } }
Create a basic Kubernetes domain resource and wait until the domain is fully up.
Create a basic Kubernetes domain resource and wait until the domain is fully up .
// create secret for admin credentials // create encryption secret // create the domain custom resource // check admin server pod is ready // check managed server pods are ready // check managed server services created