ExternalLinkUtils { public static String getExternalLogViewer(final Props azkProps, final String jobId, final Props jobProps) { if (!azkProps .containsKey(Constants.ConfigurationKeys.AZKABAN_SERVER_EXTERNAL_LOGVIEWER_TOPIC)) { return ""; } final String topic = azkProps .getString(Constants.ConfigurationKeys.AZKABAN_SERVER_EXTERNAL_LOGVIEWER_TOPIC); return getLinkFromJobAndExecId(topic, azkProps, jobId, jobProps); }  static String getExternalAnalyzerOnReq(final Props azkProps,
      final HttpServletRequest req); static String getExternalLogViewer(final Props azkProps, final String jobId,
      final Props jobProps);  }
@Test public void testGetExternalLogViewerValidFormat() { this.azkProps.put(Constants.ConfigurationKeys.AZKABAN_SERVER_EXTERNAL_LOGVIEWER_TOPIC, EXTERNAL_LOGVIEWER_TOPIC); this.azkProps.put( Constants.ConfigurationKeys.AZKABAN_SERVER_EXTERNAL_TOPIC_URL .replace("${topic}", EXTERNAL_LOGVIEWER_TOPIC), EXTERNAL_LOGVIEWER_URL_VALID_FORMAT); final String externalURL = ExternalLinkUtils.getExternalLogViewer(this.azkProps, this.jobId, this.jobProps); assertTrue(externalURL.equals(EXTERNAL_LOGVIEWER_EXPECTED_URL)); }
@Test public void testGetLogViewerNotConfigured() { final String executionExternalLinkURL = ExternalLinkUtils.getExternalLogViewer(this.azkProps, this.jobId, this.jobProps); assertTrue(executionExternalLinkURL.equals("")); }