integration-tests/src/test/java/oracle/kubernetes/operator/ItUsabilityOperatorHelmChart.java
@Test
  public void testTargetNsIsNotPreexistedNegativeInstall() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    Operator operator = null;
    Map<String, Object> operatorMap = createOperatorMap(getNewSuffixCount(), false, "usab");
    operator =
        new Operator(operatorMap,
            true,
            true,
            false,
            RestCertType.SELF_SIGNED);
    String oprelease = (String)(operator.getOperatorMap()).get("releaseName");
    String opnamespace = (String)(operator.getOperatorMap()).get("namespace");

    boolean installFailed = true;
    boolean gotExpectedInfo = true;
    try {
      operator.callHelmInstall();
      installFailed = false;
    } catch (Exception ex) {
      LoggerHelper.getLocal().log(Level.INFO, "Caught exception " + ex.getMessage() + ex.getStackTrace());
      if (!ex.getMessage()
          .contains(" namespaces \""  
                  + ((ArrayList<String>) operatorMap.get("domainNamespaces")).get(0) + "\" not found")) {
        gotExpectedInfo = false;
      }
    } finally {
      if (operator != null) {
        operator.destroy();
      }
    }
    Assertions.assertTrue(installFailed, "Operator helm installation should fail");
    Assertions.assertTrue(gotExpectedInfo, "Helm installation should fail with correct exception string");
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - " + testMethodName);
  }
/**
   * Install an operator with a non-existing target domain namespace.
   * The installation should fail with following exception 
   * Error: namespaces "usab-domainns-1" not found
   *
   * @throws Exception when operator installation does not fail
   */
Install an operator with a non-existing target domain namespace.
The installation should fail with following exception
Error: namespaces "usab-domainns-1" not found

@throws Exception when operator installation does not fail
Install an operator with a non - existing target domain namespace . The installation should fail with following exception Error : namespaces " usab - domainns - 1 " not found @throws Exception when operator installation does not fail
@Test
  public void testTargetNsIsNotPreexistedNegativeInstall() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    Operator operator = null;
    Map<String, Object> operatorMap = createOperatorMap(getNewSuffixCount(), false, "usab");
    operator =
        new Operator(operatorMap,
            true,
            true,
            false,
            RestCertType.SELF_SIGNED);
    String oprelease = (String)(operator.getOperatorMap()).get("releaseName");
    String opnamespace = (String)(operator.getOperatorMap()).get("namespace");
    boolean installFailed = true;
    boolean gotExpectedInfo = true;
    try {
      operator.callHelmInstall();
      installFailed = false;
    } catch (Exception ex) {
      LoggerHelper.getLocal().log(Level.INFO, "Caught exception " + ex.getMessage() + ex.getStackTrace());
      if (!ex.getMessage()
          .contains(" namespaces \""  
                  + ((ArrayList<String>) operatorMap.get("domainNamespaces")).get(0) + "\" not found")) {
        gotExpectedInfo = false;
      }
    } finally {
      if (operator != null) {
        operator.destroy();
      }
    }
    Assertions.assertTrue(installFailed, "Operator helm installation should fail");
    Assertions.assertTrue(gotExpectedInfo, "Helm installation should fail with correct exception string");
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - " + testMethodName);
  }
@ Test public void testTargetNsIsNotPreexistedNegativeInstall ( ) throws Exception { Assumptions . assumeTrue ( FULLTEST ) ; String testMethodName = new Object ( ) { } . getClass ( ) . getEnclosingMethod ( ) . getName ( ) ; logTestBegin ( testMethodName ) ; Operator operator = null ; Map < String , Object > operatorMap = createOperatorMap ( getNewSuffixCount ( ) , false , "usab" ) ; operator = new Operator ( operatorMap , true , true , false , RestCertType . SELF_SIGNED ) ; String oprelease = ( String ) ( operator . getOperatorMap ( ) ) . get ( "releaseName" ) ; String opnamespace = ( String ) ( operator . getOperatorMap ( ) ) . get ( "namespace" ) ; boolean installFailed = true ; boolean gotExpectedInfo = true ; try { operator . callHelmInstall ( ) ; installFailed = false ; } catch ( Exception ex ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Caught exception " + ex . getMessage ( ) + ex . getStackTrace ( ) ) ; if ( ! ex . getMessage ( ) . contains ( " namespaces \"" + ( ( ArrayList < String > ) operatorMap . get ( "domainNamespaces" ) ) . get ( 0 ) + "\" not found" ) ) { gotExpectedInfo = false ; } } finally { if ( operator != null ) { operator . destroy ( ) ; } } Assertions . assertTrue ( installFailed , "Operator helm installation should fail" ) ; Assertions . assertTrue ( gotExpectedInfo , "Helm installation should fail with correct exception string" ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "SUCCESS - " + testMethodName ) ; }
Install an operator with a non-existing target domain namespace.
Install an operator with a non - existing target domain namespace .