new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiAddCluster.java
private void createClusterConfigMap(String configMapName, String modelFile) {
    Map<String, String> labels = new HashMap<>();
    labels.put("weblogic.domainUid", domainUid);
    String dsModelFile =  String.format("%s/%s", MODEL_DIR,modelFile);
    Map<String, String> data = new HashMap<>();
    String cmData = null;
    cmData = assertDoesNotThrow(() -> Files.readString(Paths.get(dsModelFile)),
        String.format("readString operation failed for %s", dsModelFile));
    assertNotNull(cmData, String.format("readString() operation failed while creating ConfigMap %s", configMapName));
    data.put(modelFile, cmData);

    V1ObjectMeta meta = new V1ObjectMeta()
        .labels(labels)
        .name(configMapName)
        .namespace(domainNamespace);
    V1ConfigMap configMap = new V1ConfigMap()
        .data(data)
        .metadata(meta);

    boolean cmCreated = assertDoesNotThrow(() -> createConfigMap(configMap),
        String.format("Can't create ConfigMap %s", configMapName));
    assertTrue(cmCreated, String.format("createConfigMap failed while creating ConfigMap %s", configMapName));
  }
// Crate a ConfigMap with a model file to add a new WebLogic cluster
Crate a ConfigMap with a model file to add a new WebLogic cluster
Crate a ConfigMap with a model file to add a new WebLogic cluster
private void createClusterConfigMap(String configMapName, String modelFile) {
    Map<String, String> labels = new HashMap<>();
    labels.put("weblogic.domainUid", domainUid);
    String dsModelFile =  String.format("%s/%s", MODEL_DIR,modelFile);
    Map<String, String> data = new HashMap<>();
    String cmData = null;
    cmData = assertDoesNotThrow(() -> Files.readString(Paths.get(dsModelFile)),
        String.format("readString operation failed for %s", dsModelFile));
    assertNotNull(cmData, String.format("readString() operation failed while creating ConfigMap %s", configMapName));
    data.put(modelFile, cmData);
    V1ObjectMeta meta = new V1ObjectMeta()
        .labels(labels)
        .name(configMapName)
        .namespace(domainNamespace);
    V1ConfigMap configMap = new V1ConfigMap()
        .data(data)
        .metadata(meta);
    boolean cmCreated = assertDoesNotThrow(() -> createConfigMap(configMap),
        String.format("Can't create ConfigMap %s", configMapName));
    assertTrue(cmCreated, String.format("createConfigMap failed while creating ConfigMap %s", configMapName));
  }
private void createClusterConfigMap ( String configMapName , String modelFile ) { Map < String , String > labels = new HashMap < > ( ) ; labels . put ( "weblogic.domainUid" , domainUid ) ; String dsModelFile = String . format ( "%s/%s" , MODEL_DIR , modelFile ) ; Map < String , String > data = new HashMap < > ( ) ; String cmData = null ; cmData = assertDoesNotThrow ( ( ) -> Files . readString ( Paths . get ( dsModelFile ) ) , String . format ( "readString operation failed for %s" , dsModelFile ) ) ; assertNotNull ( cmData , String . format ( "readString() operation failed while creating ConfigMap %s" , configMapName ) ) ; data . put ( modelFile , cmData ) ; V1ObjectMeta meta = new V1ObjectMeta ( ) . labels ( labels ) . name ( configMapName ) . namespace ( domainNamespace ) ; V1ConfigMap configMap = new V1ConfigMap ( ) . data ( data ) . metadata ( meta ) ; boolean cmCreated = assertDoesNotThrow ( ( ) -> createConfigMap ( configMap ) , String . format ( "Can't create ConfigMap %s" , configMapName ) ) ; assertTrue ( cmCreated , String . format ( "createConfigMap failed while creating ConfigMap %s" , configMapName ) ) ; }
Crate a ConfigMap with a model file to add a new WebLogic cluster
Crate a ConfigMap with a model file to add a new WebLogic cluster