K8sRemoteInterpreterProcess extends RemoteInterpreterProcess { @VisibleForTesting String sparkUiWebUrlFromTemplate(String templateString, int port, String serviceName, String serviceDomain) { ImmutableMap<String, Object> binding = ImmutableMap.of( "PORT", port, "SERVICE_NAME", serviceName, ENV_SERVICE_DOMAIN, serviceDomain ); ClassLoader oldCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); Jinjava jinja = new Jinjava(); return jinja.render(templateString, binding); } finally { Thread.currentThread().setContextClassLoader(oldCl); } } K8sRemoteInterpreterProcess(
          KubernetesClient client,
          String namespace,
          File specTemplates,
          String containerImage,
          String interpreterGroupId,
          String interpreterGroupName,
          String interpreterSettingName,
          Properties properties,
          Map<String, String> envs,
          String intpEventServerHost,
          int intpEventServerPort,
          boolean portForward,
          String sparkImage,
          int connectTimeout,
          int connectionPoolSize,
          boolean isUserImpersonatedForSpark
  ); String getPodName(); String getNamespace(); @Override String getInterpreterGroupId(); @Override String getInterpreterSettingName(); @Override void start(String userName); @Override void stop(); @Override String getHost(); @Override int getPort(); @Override boolean isRunning(); @Override void processStarted(int port, String host); @Override String getErrorMessage();  }
@Test public void testSparkUiWebUrlTemplate() { Properties properties = new Properties(); HashMap<String, String> envs = new HashMap<String, String>(); envs.put("SERVICE_DOMAIN", "mydomain"); K8sRemoteInterpreterProcess intp = new K8sRemoteInterpreterProcess( server.getClient(), "default", new File(".skip"), "interpreter-container:1.0", "shared_process", "spark", "myspark", properties, envs, "zeppelin.server.service", 12320, false, "spark-container:1.0", 10, 10, false); assertEquals("static.url", intp.sparkUiWebUrlFromTemplate( "static.url", 4040, "zeppelin-server", "my.domain.com")); assertEquals(" intp.sparkUiWebUrlFromTemplate( " 4040, "zeppelin-server", "my.domain.com")); }