new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItConfigDistributionStrategy.java
@AfterEach
  public void afterEach() {
    deleteConfigMap(overridecm, domainNamespace);
    String patchStr
        = "["
        + "{\"op\": \"remove\", \"path\": \"/spec/configuration/overridesConfigMap\"}"
        + "]";
    logger.info("Updating domain configuration using patch string: {0}", patchStr);
    V1Patch patch = new V1Patch(patchStr);
    patchDomainCustomResource(domainUid, domainNamespace, patch, V1Patch.PATCH_FORMAT_JSON_PATCH);
    restartDomain();

    logger.info("Getting node port for default channel");
    int serviceNodePort = assertDoesNotThrow(()
        -> getServiceNodePort(domainNamespace, adminServerPodName + "-external", "default"),
        "Getting admin server node port failed");

    logger.info("Getting the list of servers using the listServers");
    String baseUri = "http://" + K8S_NODEPORT_HOST + ":" + serviceNodePort + "/clusterview/";
    String serverListUri = "ClusterViewServlet?listServers=true";
    for (int i = 0; i < 5; i++) {
      assertDoesNotThrow(() -> TimeUnit.SECONDS.sleep(30));
      HttpResponse<String> response = assertDoesNotThrow(() -> OracleHttpClient.get(baseUri + serverListUri, true));
      assertEquals(200, response.statusCode(), "Status code not equals to 200");
    }
  }
/**
   * Delete the overrides and restart domain to get clean state.
   */
Delete the overrides and restart domain to get clean state.
Delete the overrides and restart domain to get clean state .
@AfterEach
  public void afterEach() {
    deleteConfigMap(overridecm, domainNamespace);
    String patchStr
        = "["
        + "{\"op\": \"remove\", \"path\": \"/spec/configuration/overridesConfigMap\"}"
        + "]";
    logger.info("Updating domain configuration using patch string: {0}", patchStr);
    V1Patch patch = new V1Patch(patchStr);
    patchDomainCustomResource(domainUid, domainNamespace, patch, V1Patch.PATCH_FORMAT_JSON_PATCH);
    restartDomain();
    logger.info("Getting node port for default channel");
    int serviceNodePort = assertDoesNotThrow(()
        -> getServiceNodePort(domainNamespace, adminServerPodName + "-external", "default"),
        "Getting admin server node port failed");
    logger.info("Getting the list of servers using the listServers");
    String baseUri = "http://" + K8S_NODEPORT_HOST + ":" + serviceNodePort + "/clusterview/";
    String serverListUri = "ClusterViewServlet?listServers=true";
    for (int i = 0; i < 5; i++) {
      assertDoesNotThrow(() -> TimeUnit.SECONDS.sleep(30));
      HttpResponse<String> response = assertDoesNotThrow(() -> OracleHttpClient.get(baseUri + serverListUri, true));
      assertEquals(200, response.statusCode(), "Status code not equals to 200");
    }
  }
@ AfterEach public void afterEach ( ) { deleteConfigMap ( overridecm , domainNamespace ) ; String patchStr = "[" + "{\"op\": \"remove\", \"path\": \"/spec/configuration/overridesConfigMap\"}" + "]" ; logger . info ( "Updating domain configuration using patch string: {0}" , patchStr ) ; V1Patch patch = new V1Patch ( patchStr ) ; patchDomainCustomResource ( domainUid , domainNamespace , patch , V1Patch . PATCH_FORMAT_JSON_PATCH ) ; restartDomain ( ) ; logger . info ( "Getting node port for default channel" ) ; int serviceNodePort = assertDoesNotThrow ( ( ) -> getServiceNodePort ( domainNamespace , adminServerPodName + "-external" , "default" ) , "Getting admin server node port failed" ) ; logger . info ( "Getting the list of servers using the listServers" ) ; String baseUri = "http://" + K8S_NODEPORT_HOST + ":" + serviceNodePort + "/clusterview/" ; String serverListUri = "ClusterViewServlet?listServers=true" ; for ( int i = 0 ; i < 5 ; i ++ ) { assertDoesNotThrow ( ( ) -> TimeUnit . SECONDS . sleep ( 30 ) ) ; HttpResponse < String > response = assertDoesNotThrow ( ( ) -> OracleHttpClient . get ( baseUri + serverListUri , true ) ) ; assertEquals ( 200 , response . statusCode ( ) , "Status code not equals to 200" ) ; } }
Delete the overrides and restart domain to get clean state.
Delete the overrides and restart domain to get clean state .