@Override
    public void configure(Binder binder) {
      AmbariMetaInfo metaInfo = createMock(AmbariMetaInfo.class);
      StackInfo stack = createMock(StackInfo.class);
      ServiceInfo service = createMock(ServiceInfo.class);

      QuickLinksConfigurationInfo qlConfigInfo = new QuickLinksConfigurationInfo();
      qlConfigInfo.setDeleted(false);
      qlConfigInfo.setFileName("parent_quicklinks.json");
      qlConfigInfo.setIsDefault(true);
      File qlFile = new File(Resources.getResource("parent_quicklinks.json").getFile()) ;
      QuickLinksConfigurationModule module = new QuickLinksConfigurationModule(qlFile, qlConfigInfo);
      module.getModuleInfo();

      AmbariManagementController amc = createMock(AmbariManagementController.class);
      expect(amc.getAmbariMetaInfo()).andReturn(metaInfo).anyTimes();
      expect(amc.getQuicklinkVisibilityController())
        .andAnswer(() -> QuickLinkVisibilityControllerFactory.get(quicklinkProfile)).anyTimes();

      try {
        expect(metaInfo.getStack(anyString(), anyString())).andReturn(stack).anyTimes();
      }
      catch (AmbariException ex) {
        throw new RuntimeException(ex);
      }
      expect(stack.getServices()).andReturn(ImmutableList.of(service)).anyTimes();
      expect(stack.getService("YARN")).andReturn(service).anyTimes();
      expect(service.getQuickLinksConfigurationsMap()).andReturn(ImmutableMap.of("YARN", qlConfigInfo));
      expect(service.getName()).andReturn("YARN").anyTimes();
      binder.bind(AmbariManagementController.class).toInstance(amc);
      replay(amc, metaInfo, stack, service);
    }
Test to prove the all links are visible if invalid profile is set
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/QuickLinkArtifactResourceProviderTest.java