integration-tests/src/test/java/oracle/kubernetes/operator/ItUsabilityOperatorHelmChart.java
@Test
  public void testCreateSecondOperatorUsingSameOperatorNsNegativeInstall() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);

    LoggerHelper.getLocal().log(Level.INFO, "Creating first operator");
    Operator firstoperator =
        new Operator(createOperatorMap(getNewSuffixCount(), true, "usab"), RestCertType.SELF_SIGNED);
    firstoperator.callHelmInstall();

    Map<String, Object> operatorMap = createOperatorMap(getNewSuffixCount(), true, "usab");
    operatorMap.replace("namespace", firstoperator.getOperatorMap().get("namespace"));
    Operator secondoperator = new Operator(operatorMap, false, true, true, RestCertType.SELF_SIGNED);
    String oprelease = (String)(secondoperator.getOperatorMap()).get("releaseName");
    String opnamespace = (String)(secondoperator.getOperatorMap()).get("namespace");
    boolean installFailed = true;
    boolean gotExpectedInfo = true;
    try {
      secondoperator.callHelmInstall();
      installFailed = false;
    } catch (Exception ex) {
      if (!ex.getMessage()
          .contains("weblogic-operator-secrets")) {
        gotExpectedInfo = false;
      }
      LoggerHelper.getLocal().log(Level.INFO, "Exception Messsage " + ex.getMessage());
    } finally {
      if (firstoperator != null) {
        firstoperator.destroy();
      }
    }
    Assertions.assertTrue(installFailed, "Second operator helm installation should fail");
    Assertions.assertTrue(gotExpectedInfo, "Helm installation should fail with correct Exception String");
    LoggerHelper.getLocal().log(Level.INFO, "SUCCESS - " + testMethodName);
  }
/**
   * Install operator usab-1 with namespace op-usab-ns.
   * Install operator usab-2 with same namesapce op-usab-ns.
   * Second operator should fail to install with following exception  
   * Error: rendered manifests contain a resource that already exists. 
   * Unable to continue with install: existing resource conflict: kind: Secret, 
   * namespace: usab-opns-1, name: weblogic-operator-secrets
   *
   * @throws Exception when second operator installation does not fail
   */
Install operator usab-1 with namespace op-usab-ns.
Install operator usab-2 with same namesapce op-usab-ns.
Second operator should fail to install with following exception
Error: rendered manifests contain a resource that already exists.

@throws Exception when second operator installation does not fail
Install operator usab - 1 with namespace op - usab - ns . Install operator usab - 2 with same namesapce op - usab - ns . Second operator should fail to install with following exception Error : rendered manifests contain a resource that already exists . @throws Exception when second operator installation does not fail
@Test
  public void testCreateSecondOperatorUsingSameOperatorNsNegativeInstall() throws Exception {
    Assumptions.assumeTrue(FULLTEST);
    String testMethodName = new Object() {
    }.getClass().getEnclosingMethod().getName();
    logTestBegin(testMethodName);
    LoggerHelper.getLocal().log(Level.INFO, "Creating first operator");
    Operator firstoperator =
        new Operator(createOperatorMap(getNewSuffixCount(), true, "usab"), RestCertType.SELF_SIGNED);
    firstoperator.callHelmInstall();
    Map<String, Object> operatorMap = createOperatorMap(getNewSuffixCount(), true, "usab");
    operatorMap.replace("namespace", firstoperator.getOperatorMap().get("namespace"));
    Operator secondoperator = new Operator(operatorMap, false, true, true, RestCertType.SELF_SIGNED);
    String oprelease = (String)(secondoperator.getOperatorMap()).get("releaseName");
    String opnamespace = (String)(secondoperator.getOperatorMap()).get("namespace");
    boolean installFailed = true;
    boolean gotExpectedInfo = true;
    try {
      secondoperator.callHelmInstall();
      installFailed = false;
    } catch (Exception ex) {
      if (!ex.getMessage()
          .contains("weblogic-operator-secrets")) {
        gotExpectedInfo = false;
      }
      LoggerHelper.getLocal().log(Level.INFO, "Exception Messsage " + ex.getMessage());
    } finally {
      if (firstoperator != null) {
        firstoperator.destroy();
      }
    }
    Assertions.assertTrue(installFailed, "Second 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 testCreateSecondOperatorUsingSameOperatorNsNegativeInstall ( ) throws Exception { Assumptions . assumeTrue ( FULLTEST ) ; String testMethodName = new Object ( ) { } . getClass ( ) . getEnclosingMethod ( ) . getName ( ) ; logTestBegin ( testMethodName ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Creating first operator" ) ; Operator firstoperator = new Operator ( createOperatorMap ( getNewSuffixCount ( ) , true , "usab" ) , RestCertType . SELF_SIGNED ) ; firstoperator . callHelmInstall ( ) ; Map < String , Object > operatorMap = createOperatorMap ( getNewSuffixCount ( ) , true , "usab" ) ; operatorMap . replace ( "namespace" , firstoperator . getOperatorMap ( ) . get ( "namespace" ) ) ; Operator secondoperator = new Operator ( operatorMap , false , true , true , RestCertType . SELF_SIGNED ) ; String oprelease = ( String ) ( secondoperator . getOperatorMap ( ) ) . get ( "releaseName" ) ; String opnamespace = ( String ) ( secondoperator . getOperatorMap ( ) ) . get ( "namespace" ) ; boolean installFailed = true ; boolean gotExpectedInfo = true ; try { secondoperator . callHelmInstall ( ) ; installFailed = false ; } catch ( Exception ex ) { if ( ! ex . getMessage ( ) . contains ( "weblogic-operator-secrets" ) ) { gotExpectedInfo = false ; } LoggerHelper . getLocal ( ) . log ( Level . INFO , "Exception Messsage " + ex . getMessage ( ) ) ; } finally { if ( firstoperator != null ) { firstoperator . destroy ( ) ; } } Assertions . assertTrue ( installFailed , "Second operator helm installation should fail" ) ; Assertions . assertTrue ( gotExpectedInfo , "Helm installation should fail with correct Exception String" ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "SUCCESS - " + testMethodName ) ; }
Install operator usab-1 with namespace op-usab-ns.
Install operator usab - 1 with namespace op - usab - ns .