@Test public void testGetPrefixForNamespaceURIWhenPrefixForNamespaceURIIsNotPresent() { final String namespaceURI = FEEL.getUri(); final Definitions definitions = mock(Definitions.class); when(dmnGraphUtils.getModelDefinitions()).thenReturn(definitions); when(definitions.getPrefixForNamespaceURI(namespaceURI)).thenReturn(Optional.empty()); final Optional<String> prefix = utils.getPrefixForNamespaceURI(namespaceURI); assertFalse(prefix.isPresent()); }
Optional<String> getPrefixForNamespaceURI(final String namespace) { final Definitions definitions = dmnGraphUtils.getModelDefinitions(); return definitions == null ? Optional.empty() : definitions.getPrefixForNamespaceURI(namespace); }
ItemDefinitionUtils { Optional<String> getPrefixForNamespaceURI(final String namespace) { final Definitions definitions = dmnGraphUtils.getModelDefinitions(); return definitions == null ? Optional.empty() : definitions.getPrefixForNamespaceURI(namespace); } }
ItemDefinitionUtils { Optional<String> getPrefixForNamespaceURI(final String namespace) { final Definitions definitions = dmnGraphUtils.getModelDefinitions(); return definitions == null ? Optional.empty() : definitions.getPrefixForNamespaceURI(namespace); } @Inject  ItemDefinitionUtils(final DMNGraphUtils dmnGraphUtils); }
ItemDefinitionUtils { Optional<String> getPrefixForNamespaceURI(final String namespace) { final Definitions definitions = dmnGraphUtils.getModelDefinitions(); return definitions == null ? Optional.empty() : definitions.getPrefixForNamespaceURI(namespace); } @Inject  ItemDefinitionUtils(final DMNGraphUtils dmnGraphUtils); Optional<ItemDefinition> findByName(final String name); List<ItemDefinition> all(); void addItemDefinitions(final List<ItemDefinition> newItemDefinitions); String getConstraintText(final ItemDefinition itemDefinition); QName normaliseTypeRef(final QName typeRef); }
ItemDefinitionUtils { Optional<String> getPrefixForNamespaceURI(final String namespace) { final Definitions definitions = dmnGraphUtils.getModelDefinitions(); return definitions == null ? Optional.empty() : definitions.getPrefixForNamespaceURI(namespace); } @Inject  ItemDefinitionUtils(final DMNGraphUtils dmnGraphUtils); Optional<ItemDefinition> findByName(final String name); List<ItemDefinition> all(); void addItemDefinitions(final List<ItemDefinition> newItemDefinitions); String getConstraintText(final ItemDefinition itemDefinition); QName normaliseTypeRef(final QName typeRef);  }