@Test
  public void testUrlOverride_duplicateDefinitions() throws Exception {
    // same link is defined twice for a service
    Component nameNode = Component.create(
      NAMENODE,
      ImmutableList.of(
        Filter.linkNameFilter(NAMENODE_UI, LINK_URL_1, true))); // this will override service level setting for the same link
    Service hdfs = Service.create(
      HDFS,
      ImmutableList.of(Filter.linkNameFilter(NAMENODE_UI, LINK_URL_2, true)), // same link on service level with different url
      ImmutableList.of(nameNode));
    Service yarn = Service.create(
      YARN,
      ImmutableList.of(Filter.linkNameFilter(NAMENODE_UI, LINK_URL_3, true)), // this belongs to an other service so doesn't affect outcome
      ImmutableList.of(nameNode));

    QuickLinksProfile profile = QuickLinksProfile.create(
      ImmutableList.of(),
      ImmutableList.of(hdfs));

    DefaultQuickLinkVisibilityController evaluator = new DefaultQuickLinkVisibilityController(profile);
    assertEquals(Optional.of(LINK_URL_1), evaluator.getUrlOverride(HDFS, namenodeUi));
  }
Test to prove that the link is hidden if no filters apply.
ambari-server/src/test/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinkVisibilityControllerTest.java