integration-tests/src/test/java/oracle/kubernetes/operator/ItServerDiscovery.java
@BeforeEach
  public void prepare() throws Exception {
    if (FULLTEST) {
      createResultAndPvDirs(testClassName);
      String testClassNameShort = "itdiscovery";
      // create operator1
      if (operator == null) {
        Map<String, Object> operatorMap = createOperatorMap(getNewSuffixCount(), true, testClassNameShort);
        operator = TestUtils.createOperator(operatorMap, Operator.RestCertType.SELF_SIGNED);
        Assertions.assertNotNull(operator);
        domainNS = ((ArrayList<String>) operatorMap.get("domainNamespaces")).get(0);
        namespaceList.append((String)operatorMap.get("namespace"));
        namespaceList.append(" ").append(domainNS);
      }
      // create domain
      if (domain == null) {
        LoggerHelper.getLocal().log(Level.INFO, "Creating WLS Domain & waiting for the script to complete execution");
        Map<String, Object> domainMap = createDomainMap(getNewSuffixCount(), testClassNameShort);
        domainMap.put("namespace", domainNS);
        domain = TestUtils.createDomain(domainMap);
        domain.verifyDomainCreated();
      }

      final String testYamlFileName = "custom-domaint.yaml";

      String domainYaml =
          getUserProjectsDir()
              + "/weblogic-domains/"
              + domain.getDomainUid()
              + "/domain.yaml";

      // create test domain yaml file
      testDomainYamlFile = getResultDir() + "/" + testYamlFileName;

      Path sourceFile = Paths.get(domainYaml);
      Path targetFile = Paths.get(testDomainYamlFile);

      Files.copy(sourceFile, targetFile, StandardCopyOption.REPLACE_EXISTING);

      String content = new String(Files.readAllBytes(targetFile), StandardCharsets.UTF_8);
      content = content.replaceAll("replicas: 2", "replicas: 3");
      Files.write(targetFile, content.getBytes(StandardCharsets.UTF_8));
    }
  }
/**
   * This method gets called before every test. It creates the result/pv root directories
   * for the test. Creates the operator and domain if its not running.
   *
   * @throws Exception exception if result/pv/operator/domain creation fails
   */
This method gets called before every test. It creates the result/pv root directories
for the test. Creates the operator and domain if its not running.

@throws Exception exception if result/pv/operator/domain creation fails
This method gets called before every test . It creates the result / pv root directories for the test . Creates the operator and domain if its not running . @throws Exception exception if result / pv / operator / domain creation fails
@BeforeEach
  public void prepare() throws Exception {
    if (FULLTEST) {
      createResultAndPvDirs(testClassName);
      String testClassNameShort = "itdiscovery";
      if (operator == null) {
        Map<String, Object> operatorMap = createOperatorMap(getNewSuffixCount(), true, testClassNameShort);
        operator = TestUtils.createOperator(operatorMap, Operator.RestCertType.SELF_SIGNED);
        Assertions.assertNotNull(operator);
        domainNS = ((ArrayList<String>) operatorMap.get("domainNamespaces")).get(0);
        namespaceList.append((String)operatorMap.get("namespace"));
        namespaceList.append(" ").append(domainNS);
      }
      if (domain == null) {
        LoggerHelper.getLocal().log(Level.INFO, "Creating WLS Domain & waiting for the script to complete execution");
        Map<String, Object> domainMap = createDomainMap(getNewSuffixCount(), testClassNameShort);
        domainMap.put("namespace", domainNS);
        domain = TestUtils.createDomain(domainMap);
        domain.verifyDomainCreated();
      }
      final String testYamlFileName = "custom-domaint.yaml";
      String domainYaml =
          getUserProjectsDir()
              + "/weblogic-domains/"
              + domain.getDomainUid()
              + "/domain.yaml";
      testDomainYamlFile = getResultDir() + "/" + testYamlFileName;
      Path sourceFile = Paths.get(domainYaml);
      Path targetFile = Paths.get(testDomainYamlFile);
      Files.copy(sourceFile, targetFile, StandardCopyOption.REPLACE_EXISTING);
      String content = new String(Files.readAllBytes(targetFile), StandardCharsets.UTF_8);
      content = content.replaceAll("replicas: 2", "replicas: 3");
      Files.write(targetFile, content.getBytes(StandardCharsets.UTF_8));
    }
  }
@ BeforeEach public void prepare ( ) throws Exception { if ( FULLTEST ) { createResultAndPvDirs ( testClassName ) ; String testClassNameShort = "itdiscovery" ; if ( operator == null ) { Map < String , Object > operatorMap = createOperatorMap ( getNewSuffixCount ( ) , true , testClassNameShort ) ; operator = TestUtils . createOperator ( operatorMap , Operator . RestCertType . SELF_SIGNED ) ; Assertions . assertNotNull ( operator ) ; domainNS = ( ( ArrayList < String > ) operatorMap . get ( "domainNamespaces" ) ) . get ( 0 ) ; namespaceList . append ( ( String ) operatorMap . get ( "namespace" ) ) ; namespaceList . append ( " " ) . append ( domainNS ) ; } if ( domain == null ) { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Creating WLS Domain & waiting for the script to complete execution" ) ; Map < String , Object > domainMap = createDomainMap ( getNewSuffixCount ( ) , testClassNameShort ) ; domainMap . put ( "namespace" , domainNS ) ; domain = TestUtils . createDomain ( domainMap ) ; domain . verifyDomainCreated ( ) ; } final String testYamlFileName = "custom-domaint.yaml" ; String domainYaml = getUserProjectsDir ( ) + "/weblogic-domains/" + domain . getDomainUid ( ) + "/domain.yaml" ; testDomainYamlFile = getResultDir ( ) + "/" + testYamlFileName ; Path sourceFile = Paths . get ( domainYaml ) ; Path targetFile = Paths . get ( testDomainYamlFile ) ; Files . copy ( sourceFile , targetFile , StandardCopyOption . REPLACE_EXISTING ) ; String content = new String ( Files . readAllBytes ( targetFile ) , StandardCharsets . UTF_8 ) ; content = content . replaceAll ( "replicas: 2" , "replicas: 3" ) ; Files . write ( targetFile , content . getBytes ( StandardCharsets . UTF_8 ) ) ; } }
This method gets called before every test.
This method gets called before every test .
// create operator1 // create domain // create test domain yaml file