@Test public void testParseProfile() throws Exception { String profileName = "example_quicklinks_profile.json"; QuickLinksProfileParser parser = new QuickLinksProfileParser(); QuickLinksProfile profile = parser.parse(Resources.getResource(profileName)); assertEquals(1, profile.getFilters().size()); assertEquals( Filter.linkAttributeFilter("sso", true), profile.getFilters().get(0)); assertEquals(3, profile.getServices().size()); Service hdfs = profile.getServices().get(0); assertEquals("HDFS", hdfs.getName()); assertEquals(1, hdfs.getFilters().size()); assertEquals(1, hdfs.getComponents().size()); assertEquals( Filter.linkAttributeFilter("authenticated", true), hdfs.getFilters().get(0)); Component nameNode = hdfs.getComponents().get(0); assertEquals(2, nameNode.getFilters().size()); assertEquals( Filter.linkNameFilter("namenode_ui", false), nameNode.getFilters().get(0)); Component historyServer = profile.getServices().get(1).getComponents().get(0); assertEquals(1, historyServer.getFilters().size()); assertEquals( Filter.acceptAllFilter(true), historyServer.getFilters().get(0)); Service yarn = profile.getServices().get(2); assertEquals(1, yarn.getFilters().size()); assertEquals( Filter.linkNameFilter("resourcemanager_ui", true), yarn.getFilters().get(0)); }
public QuickLinksProfile parse(byte[] input) throws IOException { return mapper.readValue(input, QuickLinksProfile.class); }
QuickLinksProfileParser { public QuickLinksProfile parse(byte[] input) throws IOException { return mapper.readValue(input, QuickLinksProfile.class); } }
QuickLinksProfileParser { public QuickLinksProfile parse(byte[] input) throws IOException { return mapper.readValue(input, QuickLinksProfile.class); } QuickLinksProfileParser(); }
QuickLinksProfileParser { public QuickLinksProfile parse(byte[] input) throws IOException { return mapper.readValue(input, QuickLinksProfile.class); } QuickLinksProfileParser(); QuickLinksProfile parse(byte[] input); QuickLinksProfile parse(URL url); String encode(QuickLinksProfile profile); }
QuickLinksProfileParser { public QuickLinksProfile parse(byte[] input) throws IOException { return mapper.readValue(input, QuickLinksProfile.class); } QuickLinksProfileParser(); QuickLinksProfile parse(byte[] input); QuickLinksProfile parse(URL url); String encode(QuickLinksProfile profile);  }