@Test public void expand() throws Exception { EdmNavigationProperty edmProperty = mock(EdmNavigationProperty.class); when(edmProperty.getName()).thenReturn("property"); final DebugTabUri tab = new DebugTabUri(new UriInfoImpl().setKind(UriInfoKind.all) .setSystemQueryOption(new ExpandOptionImpl().addExpandItem( new ExpandItemImpl().setResourcePath( new UriInfoImpl().setKind(UriInfoKind.resource) .addResourcePart(new UriResourceNavigationPropertyImpl(edmProperty))) .setSystemQueryOption(new LevelsOptionImpl().setValue(1))))); assertEquals("{\"kind\":\"all\",\"expand\":[{\"expandPath\":[" + "{\"uriResourceKind\":\"navigationProperty\",\"segment\":\"property\",\"isCollection\":false}]," + "\"levels\":1}]}", createJson(tab)); final String html = createHtml(tab); assertThat(html, allOf( startsWith("<h2>Kind</h2>\n" + "<p>all</p>\n" + "<h2>Expand Option</h2>\n" + "<ul>\n" + "<li class=\"json\">"), containsString("navigationProperty"), containsString("property"), containsString("isCollection"), containsString("false"))); assertThat(html, allOf(containsString("levels"), endsWith("</li>\n</ul>\n"))); }
@Override public String getName() { return "URI"; }
DebugTabUri implements DebugTab { @Override public String getName() { return "URI"; } }
DebugTabUri implements DebugTab { @Override public String getName() { return "URI"; } DebugTabUri(final UriInfo uriInfo); }
DebugTabUri implements DebugTab { @Override public String getName() { return "URI"; } DebugTabUri(final UriInfo uriInfo); @Override String getName(); @Override void appendJson(final JsonGenerator gen); @Override void appendHtml(final Writer writer); }
DebugTabUri implements DebugTab { @Override public String getName() { return "URI"; } DebugTabUri(final UriInfo uriInfo); @Override String getName(); @Override void appendJson(final JsonGenerator gen); @Override void appendHtml(final Writer writer);  }