NamespaceContextMap implements NamespaceContext { @Override public final String getNamespaceURI(final String prefix) { final String uri = prefixMap.get(prefix); if (uri == null) { return XMLConstants.NULL_NS_URI; } return uri; } NamespaceContextMap(@Nullable final String... values); @Override final String getNamespaceURI(final String prefix); @Override final String getPrefix(final String namespaceURI); @Override final Iterator<String> getPrefixes(final String namespaceURI);  }
@Test public void testGetNamespaceURIUnbound() { assertThat(testee.getNamespaceURI("xyz")).isEqualTo(XMLConstants.NULL_NS_URI); }
@Test public void testGetNamespaceURIBound() { assertThat(testee.getNamespaceURI("abc")).isEqualTo("http: assertThat(testee.getNamespaceURI("def")).isEqualTo("http: assertThat(testee.getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX)).isEqualTo(XMLConstants.NULL_NS_URI); assertThat(testee.getNamespaceURI(XMLConstants.XML_NS_PREFIX)).isEqualTo(XMLConstants.XML_NS_URI); assertThat(testee.getNamespaceURI(XMLConstants.XMLNS_ATTRIBUTE)).isEqualTo(XMLConstants.XMLNS_ATTRIBUTE_NS_URI ); }