DetachedSignatureResolver extends ResourceResolverSpi { @Override public boolean engineCanResolveURI(ResourceResolverContext context) { return (nullURI(context) || definedFilename(context)); } DetachedSignatureResolver(final List<DSSDocument> documents, DigestAlgorithm digestAlgorithm); @Override XMLSignatureInput engineResolveURI(ResourceResolverContext context); @Override boolean engineCanResolveURI(ResourceResolverContext context);  }
@Test public void attributeIsAnchor() { DetachedSignatureResolver resolver = new DetachedSignatureResolver(Collections.<DSSDocument>emptyList(), DigestAlgorithm.SHA256); Attr attr = mock(Attr.class); when(attr.getNodeValue()).thenReturn("#id_tag"); ResourceResolverContext context = new ResourceResolverContext(attr, null, false); assertFalse(resolver.engineCanResolveURI(context)); }