new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSimpleValidation.java
@Test
  @Order(1)
  @DisplayName("Install operator and verify its running")
  @Slow
  @MustNotRunInParallel
  public void testInstallingOperator() {

    String image = getOperatorImageName();
    assertFalse(image.isEmpty(), "Operator image name can not be empty");
    logger.info("Operator image name {0}", image);

    logger.info("Creating Docker registry secret in the operator namespace "
        + "{0} to pull the image from repository", opNamespace);
    JsonObject dockerConfigJsonObject = createDockerConfigJson(
        REPO_USERNAME, REPO_PASSWORD, REPO_EMAIL, REPO_REGISTRY);
    String dockerConfigJson = dockerConfigJsonObject.toString();

    logger.info("Creating the V1Secret configuration");
    V1Secret repoSecret = new V1Secret()
        .metadata(new V1ObjectMeta()
            .name(REPO_SECRET_NAME)
            .namespace(opNamespace))
        .type("kubernetes.io/dockerconfigjson")
        .putDataItem(".dockerconfigjson", dockerConfigJson.getBytes());

    boolean secretCreated = assertDoesNotThrow(() -> createSecret(repoSecret),
        String.format("createSecret failed for %s", REPO_SECRET_NAME));
    assertTrue(secretCreated, String.format("createSecret failed while creating secret %s", REPO_SECRET_NAME));

    // map with secret
    Map<String, Object> secretNameMap = new HashMap<>();
    secretNameMap.put("name", REPO_SECRET_NAME);

    logger.info("Creating helm install parameters object");
    HelmParams opHelmParams = new HelmParams()
        .releaseName(OPERATOR_RELEASE_NAME)
        .namespace(opNamespace)
        .chartDir(OPERATOR_CHART_DIR);

    logger.info("Creating operator chart values to override object");
    OperatorParams opParams =
        new OperatorParams()
            .helmParams(opHelmParams)
            .image(image)
            .imagePullSecrets(secretNameMap)
            .domainNamespaces(Arrays.asList(domainNamespace1))
            .serviceAccount(serviceAccountName);

    // install Operator
    logger.info("Installing operator in namespace {0}", opNamespace);
    assertTrue(installOperator(opParams),
        String.format("Operator install failed in namespace %s", opNamespace));
    logger.info("Operator installed in namespace {0}", opNamespace);

    // list helm releases matching Operator release name in operator namespace
    logger.info("Checking operator release {0} status in namespace {1}",
        OPERATOR_RELEASE_NAME, opNamespace);
    assertTrue(isHelmReleaseDeployed(OPERATOR_RELEASE_NAME, opNamespace),
        String.format("Operator release %s is not in deployed status in namespace %s",
        OPERATOR_RELEASE_NAME, opNamespace));
    logger.info("Operator release {0} status is deployed in namespace {1}",
        OPERATOR_RELEASE_NAME, opNamespace);

    // check operator is running
    logger.info("Check operator pod is running in namespace {0}", opNamespace);
    with().pollDelay(2, SECONDS)
        .and().with().pollInterval(10, SECONDS)
        .atMost(5, MINUTES).await()
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for operator to be running in namespace {0} "
                    + "(elapsed time {1}ms, remaining time {2}ms)",
                opNamespace,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(operatorIsReady(opNamespace));
    logger.info("Operator is ready in namespace {0}", opNamespace);

  }
/**
   * Install Operator and verify operator is running.
   */
Install Operator and verify operator is running.
Install Operator and verify operator is running .
@Test
  @Order(1)
  @DisplayName("Install operator and verify its running")
  @Slow
  @MustNotRunInParallel
  public void testInstallingOperator() {
    String image = getOperatorImageName();
    assertFalse(image.isEmpty(), "Operator image name can not be empty");
    logger.info("Operator image name {0}", image);
    logger.info("Creating Docker registry secret in the operator namespace "
        + "{0} to pull the image from repository", opNamespace);
    JsonObject dockerConfigJsonObject = createDockerConfigJson(
        REPO_USERNAME, REPO_PASSWORD, REPO_EMAIL, REPO_REGISTRY);
    String dockerConfigJson = dockerConfigJsonObject.toString();
    logger.info("Creating the V1Secret configuration");
    V1Secret repoSecret = new V1Secret()
        .metadata(new V1ObjectMeta()
            .name(REPO_SECRET_NAME)
            .namespace(opNamespace))
        .type("kubernetes.io/dockerconfigjson")
        .putDataItem(".dockerconfigjson", dockerConfigJson.getBytes());
    boolean secretCreated = assertDoesNotThrow(() -> createSecret(repoSecret),
        String.format("createSecret failed for %s", REPO_SECRET_NAME));
    assertTrue(secretCreated, String.format("createSecret failed while creating secret %s", REPO_SECRET_NAME));
    Map<String, Object> secretNameMap = new HashMap<>();
    secretNameMap.put("name", REPO_SECRET_NAME);
    logger.info("Creating helm install parameters object");
    HelmParams opHelmParams = new HelmParams()
        .releaseName(OPERATOR_RELEASE_NAME)
        .namespace(opNamespace)
        .chartDir(OPERATOR_CHART_DIR);
    logger.info("Creating operator chart values to override object");
    OperatorParams opParams =
        new OperatorParams()
            .helmParams(opHelmParams)
            .image(image)
            .imagePullSecrets(secretNameMap)
            .domainNamespaces(Arrays.asList(domainNamespace1))
            .serviceAccount(serviceAccountName);
    logger.info("Installing operator in namespace {0}", opNamespace);
    assertTrue(installOperator(opParams),
        String.format("Operator install failed in namespace %s", opNamespace));
    logger.info("Operator installed in namespace {0}", opNamespace);
    logger.info("Checking operator release {0} status in namespace {1}",
        OPERATOR_RELEASE_NAME, opNamespace);
    assertTrue(isHelmReleaseDeployed(OPERATOR_RELEASE_NAME, opNamespace),
        String.format("Operator release %s is not in deployed status in namespace %s",
        OPERATOR_RELEASE_NAME, opNamespace));
    logger.info("Operator release {0} status is deployed in namespace {1}",
        OPERATOR_RELEASE_NAME, opNamespace);
    logger.info("Check operator pod is running in namespace {0}", opNamespace);
    with().pollDelay(2, SECONDS)
        .and().with().pollInterval(10, SECONDS)
        .atMost(5, MINUTES).await()
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for operator to be running in namespace {0} "
                    + "(elapsed time {1}ms, remaining time {2}ms)",
                opNamespace,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(operatorIsReady(opNamespace));
    logger.info("Operator is ready in namespace {0}", opNamespace);
  }
@ Test @ Order ( 1 ) @ DisplayName ( "Install operator and verify its running" ) @ Slow @ MustNotRunInParallel public void testInstallingOperator ( ) { String image = getOperatorImageName ( ) ; assertFalse ( image . isEmpty ( ) , "Operator image name can not be empty" ) ; logger . info ( "Operator image name {0}" , image ) ; logger . info ( "Creating Docker registry secret in the operator namespace " + "{0} to pull the image from repository" , opNamespace ) ; JsonObject dockerConfigJsonObject = createDockerConfigJson ( REPO_USERNAME , REPO_PASSWORD , REPO_EMAIL , REPO_REGISTRY ) ; String dockerConfigJson = dockerConfigJsonObject . toString ( ) ; logger . info ( "Creating the V1Secret configuration" ) ; V1Secret repoSecret = new V1Secret ( ) . metadata ( new V1ObjectMeta ( ) . name ( REPO_SECRET_NAME ) . namespace ( opNamespace ) ) . type ( "kubernetes.io/dockerconfigjson" ) . putDataItem ( ".dockerconfigjson" , dockerConfigJson . getBytes ( ) ) ; boolean secretCreated = assertDoesNotThrow ( ( ) -> createSecret ( repoSecret ) , String . format ( "createSecret failed for %s" , REPO_SECRET_NAME ) ) ; assertTrue ( secretCreated , String . format ( "createSecret failed while creating secret %s" , REPO_SECRET_NAME ) ) ; Map < String , Object > secretNameMap = new HashMap < > ( ) ; secretNameMap . put ( "name" , REPO_SECRET_NAME ) ; logger . info ( "Creating helm install parameters object" ) ; HelmParams opHelmParams = new HelmParams ( ) . releaseName ( OPERATOR_RELEASE_NAME ) . namespace ( opNamespace ) . chartDir ( OPERATOR_CHART_DIR ) ; logger . info ( "Creating operator chart values to override object" ) ; OperatorParams opParams = new OperatorParams ( ) . helmParams ( opHelmParams ) . image ( image ) . imagePullSecrets ( secretNameMap ) . domainNamespaces ( Arrays . asList ( domainNamespace1 ) ) . serviceAccount ( serviceAccountName ) ; logger . info ( "Installing operator in namespace {0}" , opNamespace ) ; assertTrue ( installOperator ( opParams ) , String . format ( "Operator install failed in namespace %s" , opNamespace ) ) ; logger . info ( "Operator installed in namespace {0}" , opNamespace ) ; logger . info ( "Checking operator release {0} status in namespace {1}" , OPERATOR_RELEASE_NAME , opNamespace ) ; assertTrue ( isHelmReleaseDeployed ( OPERATOR_RELEASE_NAME , opNamespace ) , String . format ( "Operator release %s is not in deployed status in namespace %s" , OPERATOR_RELEASE_NAME , opNamespace ) ) ; logger . info ( "Operator release {0} status is deployed in namespace {1}" , OPERATOR_RELEASE_NAME , opNamespace ) ; logger . info ( "Check operator pod is running in namespace {0}" , opNamespace ) ; with ( ) . pollDelay ( 2 , SECONDS ) . and ( ) . with ( ) . pollInterval ( 10 , SECONDS ) . atMost ( 5 , MINUTES ) . await ( ) . conditionEvaluationListener ( condition -> logger . info ( "Waiting for operator to be running in namespace {0} " + "(elapsed time {1}ms, remaining time {2}ms)" , opNamespace , condition . getElapsedTimeInMS ( ) , condition . getRemainingTimeInMS ( ) ) ) . until ( operatorIsReady ( opNamespace ) ) ; logger . info ( "Operator is ready in namespace {0}" , opNamespace ) ; }
Install Operator and verify operator is running.
Install Operator and verify operator is running .
// map with secret // install Operator // list helm releases matching Operator release name in operator namespace // check operator is running