YarnClusterResourceURLBuilder { public static String buildClusterMetricsURL(String urlBase) { return PathResolverHelper.buildUrlPath(urlBase, CLUSTER_METRICS_API_URL + "?" + ANONYMOUS_PARAMETER); }  static String buildSchedulerInfoURL(String urlBase); static String buildClusterMetricsURL(String urlBase); static String buildRunningAppsURL(String urlBase); static String buildAcceptedAndRunningAppsURL(String urlBase); static String buildAcceptedAppsURL(String urlBase); static String buildAcceptedAppTrackingURL(String urlBase, String appId); static String buildFinishedAppsURL(String urlBase);  }
@Test public void testBuildClusterMetricsURLWithBaseURLTailingSlash() { String resolvedUrl = YarnClusterResourceURLBuilder.buildClusterMetricsURL(BASE_URL_WITH_TAILING_SLASH); Assert.assertEquals("unexpected url composed for fetching cluster metrics", EXPECTED_CLUSTER_METRICS_URL, resolvedUrl); }
@Test public void testBuildClusterMetricsURLWithoutBaseURLTailingSlash() { String resolvedUrl = YarnClusterResourceURLBuilder.buildClusterMetricsURL(BASE_URL_WITHOUT_TAILING_SLASH); Assert.assertEquals("unexpected url composed for fetching cluster metrics", EXPECTED_CLUSTER_METRICS_URL, resolvedUrl); }