@Test public void testGetZeppelinHubWsEndpoint() { System.setProperty(ZeppelinHubRepo.ZEPPELIN_CONF_PROP_NAME_SERVER, testAddr); ZeppelinConfiguration config = new ZeppelinConfiguration(); ZeppelinHubRepo repository = new ZeppelinHubRepo(config); assertThat(repository.getZeppelinhubWebsocketUri(config)).isEqualTo("ws: System.setProperty(ZeppelinHubRepo.ZEPPELIN_CONF_PROP_NAME_SERVER, "https: config = new ZeppelinConfiguration(); repository = new ZeppelinHubRepo(config); assertThat(repository.getZeppelinhubWebsocketUri(config)).isEqualTo("wss: System.setProperty(ZeppelinHubRepo.ZEPPELIN_CONF_PROP_NAME_SERVER, "yolow"); config = new ZeppelinConfiguration(); repository = new ZeppelinHubRepo(config); assertThat(repository.getZeppelinhubWebsocketUri(config)).isEqualTo("wss: System.setProperty(ZeppelinHubRepo.ZEPPELIN_CONF_PROP_NAME_SERVER, "http: config = new ZeppelinConfiguration(); repository = new ZeppelinHubRepo(config); assertThat(repository.getZeppelinhubWebsocketUri(config)).isEqualTo("ws: System.setProperty(ZeppelinHubRepo.ZEPPELIN_CONF_PROP_NAME_SERVER, "https: config = new ZeppelinConfiguration(); repository = new ZeppelinHubRepo(config); assertThat(repository.getZeppelinhubWebsocketUri(config)).isEqualTo("wss: System.setProperty(ZeppelinHubRepo.ZEPPELIN_CONF_PROP_NAME_SERVER, "http: config = new ZeppelinConfiguration(); repository = new ZeppelinHubRepo(config); assertThat(repository.getZeppelinhubWebsocketUri(config)).isEqualTo("ws: System.setProperty(ZeppelinHubRepo.ZEPPELIN_CONF_PROP_NAME_SERVER, "https: config = new ZeppelinConfiguration(); repository = new ZeppelinHubRepo(config); assertThat(repository.getZeppelinhubWebsocketUri(config)).isEqualTo("wss: }
String getZeppelinhubWebsocketUri(ZeppelinConfiguration conf) { String zeppelinHubUri = StringUtils.EMPTY; try { zeppelinHubUri = getZeppelinHubWsUri(new URI(conf.getString("ZEPPELINHUB_API_ADDRESS", ZEPPELIN_CONF_PROP_NAME_SERVER, DEFAULT_SERVER))); } catch (URISyntaxException e) { LOG.error("Cannot get ZeppelinHub URI", e); } return zeppelinHubUri; }
ZeppelinHubRepo implements NotebookRepo { String getZeppelinhubWebsocketUri(ZeppelinConfiguration conf) { String zeppelinHubUri = StringUtils.EMPTY; try { zeppelinHubUri = getZeppelinHubWsUri(new URI(conf.getString("ZEPPELINHUB_API_ADDRESS", ZEPPELIN_CONF_PROP_NAME_SERVER, DEFAULT_SERVER))); } catch (URISyntaxException e) { LOG.error("Cannot get ZeppelinHub URI", e); } return zeppelinHubUri; } }
ZeppelinHubRepo implements NotebookRepo { String getZeppelinhubWebsocketUri(ZeppelinConfiguration conf) { String zeppelinHubUri = StringUtils.EMPTY; try { zeppelinHubUri = getZeppelinHubWsUri(new URI(conf.getString("ZEPPELINHUB_API_ADDRESS", ZEPPELIN_CONF_PROP_NAME_SERVER, DEFAULT_SERVER))); } catch (URISyntaxException e) { LOG.error("Cannot get ZeppelinHub URI", e); } return zeppelinHubUri; } ZeppelinHubRepo(ZeppelinConfiguration conf); }
ZeppelinHubRepo implements NotebookRepo { String getZeppelinhubWebsocketUri(ZeppelinConfiguration conf) { String zeppelinHubUri = StringUtils.EMPTY; try { zeppelinHubUri = getZeppelinHubWsUri(new URI(conf.getString("ZEPPELINHUB_API_ADDRESS", ZEPPELIN_CONF_PROP_NAME_SERVER, DEFAULT_SERVER))); } catch (URISyntaxException e) { LOG.error("Cannot get ZeppelinHub URI", e); } return zeppelinHubUri; } ZeppelinHubRepo(ZeppelinConfiguration conf); @Override List<NoteInfo> list(AuthenticationInfo subject); @Override Note get(String noteId, AuthenticationInfo subject); @Override void save(Note note, AuthenticationInfo subject); @Override void remove(String noteId, AuthenticationInfo subject); @Override void close(); @Override Revision checkpoint(String noteId, String checkpointMsg, AuthenticationInfo subject); @Override Note get(String noteId, String revId, AuthenticationInfo subject); @Override List<Revision> revisionHistory(String noteId, AuthenticationInfo subject); @Override List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject); @Override void updateSettings(Map<String, String> settings, AuthenticationInfo subject); @Override Note setNoteRevision(String noteId, String revId, AuthenticationInfo subject); }
ZeppelinHubRepo implements NotebookRepo { String getZeppelinhubWebsocketUri(ZeppelinConfiguration conf) { String zeppelinHubUri = StringUtils.EMPTY; try { zeppelinHubUri = getZeppelinHubWsUri(new URI(conf.getString("ZEPPELINHUB_API_ADDRESS", ZEPPELIN_CONF_PROP_NAME_SERVER, DEFAULT_SERVER))); } catch (URISyntaxException e) { LOG.error("Cannot get ZeppelinHub URI", e); } return zeppelinHubUri; } ZeppelinHubRepo(ZeppelinConfiguration conf); @Override List<NoteInfo> list(AuthenticationInfo subject); @Override Note get(String noteId, AuthenticationInfo subject); @Override void save(Note note, AuthenticationInfo subject); @Override void remove(String noteId, AuthenticationInfo subject); @Override void close(); @Override Revision checkpoint(String noteId, String checkpointMsg, AuthenticationInfo subject); @Override Note get(String noteId, String revId, AuthenticationInfo subject); @Override List<Revision> revisionHistory(String noteId, AuthenticationInfo subject); @Override List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject); @Override void updateSettings(Map<String, String> settings, AuthenticationInfo subject); @Override Note setNoteRevision(String noteId, String revId, AuthenticationInfo subject); static final String TOKEN_HEADER; }