ConfigurationBasedNamespaceManager extends AbstractNamespaceManager { @Override public String getPrefix(String namespace) { if (namespace == null) { namespace = ""; } String prefix = configuration.getString(namespace); if (prefix == null || prefix.isEmpty()) { prefix = this.namespaceToPrefixMap.get(namespace); if (prefix == null) { prefix = this.generatePrefix(namespace); this.namespaceToPrefixMap.put(namespace, prefix); } } return prefix; } ConfigurationBasedNamespaceManager(Configuration configuration); @Override String getPrefix(String namespace); @Override boolean hasPermanentProperties(String namespace); @Override void removeNamespaceProperties(String namespace); @Override void setNamespaceProperties(String namespace, NamespaceProperties properties); @Override Map<String, NamespaceProperties> getAllNamespaces(); @Override void clear(); @Override void addAllPermanent(Collection<NamespaceProperties> properties); @Override void replaceAll(Map<String, NamespaceProperties> map); @Override NamespaceProperties getNamespaceProperties(String namespace); @Override boolean isPatternNamespace(String namespace); @Override boolean isSecureCollection(String namespace); @Override boolean isGeneratedNamespace(String namespace);  }
@Test public void openToscaNodeTypesCorrectAtSecondCall() { assertEquals("otntyIexample", this.configurationBasedNamespaceManager.getPrefix("http: assertEquals("otntyIexample", this.configurationBasedNamespaceManager.getPrefix("http: }
@Test public void openToscaNodeTypesCorrectAtSimilarNamespaces() { assertEquals("otntyIexample", this.configurationBasedNamespaceManager.getPrefix("http: assertEquals("otntyIexample1", this.configurationBasedNamespaceManager.getPrefix("http: }
@Test public void openToscaNodeTypesCorrectAtSimilarNamespacesWithUniqueness() { assertEquals("otntyIexample", this.configurationBasedNamespaceManager.getPrefix("http: assertEquals("otntyIexample1", this.configurationBasedNamespaceManager.getPrefix("http: assertEquals("otntyIexample", this.configurationBasedNamespaceManager.getPrefix("http: assertEquals("otntyIexample1", this.configurationBasedNamespaceManager.getPrefix("http: }
@Test public void xmlNullNamespaceHasPrefix() { assertEquals("null", this.configurationBasedNamespaceManager.getPrefix("")); }
@Test public void nullNamespaceHasPrefix() { assertEquals("null", this.configurationBasedNamespaceManager.getPrefix((String) null)); }