Class ChainingEncryptedKeyResolverTest
java.lang.Object
org.opensaml.core.testing.OpenSAMLInitBaseTestCase
org.opensaml.core.testing.XMLObjectBaseTestCase
org.opensaml.xmlsec.encryption.support.tests.ChainingEncryptedKeyResolverTest
public class ChainingEncryptedKeyResolverTest
extends org.opensaml.core.testing.XMLObjectBaseTestCase
Test the encrypted key resolver which dereferences RetrievalMethods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChainingEncryptedKeyResolverThe resolver instance to be tested.private List<EncryptedKeyResolver>Fields inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate List<EncryptedKey>generateList(EncryptedData encData, EncryptedKeyResolver ekResolver, Set<String> recipients) Resolve EncryptedKeys and put them in an ordered list.private List<EncryptedKey>Extract all the EncryptedKey's from the SignableSimpleXMLObject.protected voidsetUp()voidTest error case of empty resolver chain.voidOne recipient specified to resolver, EncryptedKeys in instance inline and via RetrievalMethod .voidTwo recipients specified to resolver, EncryptedKeys in instance inline and via RetrievalMethod .voidMulti recipient specified to resolver via ctor and method args.voidOne recipient specified to resolver, EncryptedKey in instance inline.voidOne recipient specified to resolver, EncryptedKey in instance via RetrievalMethod .Methods inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElementMethods inherited from class org.opensaml.core.testing.OpenSAMLInitBaseTestCase
initOpenSAML
-
Field Details
-
resolver
The resolver instance to be tested. -
resolverChain
-
recipients
-
-
Constructor Details
-
ChainingEncryptedKeyResolverTest
public ChainingEncryptedKeyResolverTest()
-
-
Method Details
-
setUp
- Throws:
Exception
-
testEmptyChain
public void testEmptyChain()Test error case of empty resolver chain. -
testSingleEKInline
public void testSingleEKInline()One recipient specified to resolver, EncryptedKey in instance inline. -
testSingleEKRetrievalMethod
public void testSingleEKRetrievalMethod()One recipient specified to resolver, EncryptedKey in instance via RetrievalMethod . -
testMultiEKWithOneRecipient
public void testMultiEKWithOneRecipient()One recipient specified to resolver, EncryptedKeys in instance inline and via RetrievalMethod . -
testMultiEKWithTwoRecipients
public void testMultiEKWithTwoRecipients()Two recipients specified to resolver, EncryptedKeys in instance inline and via RetrievalMethod . -
testMultiRecipientsCtorAndArgs
public void testMultiRecipientsCtorAndArgs()Multi recipient specified to resolver via ctor and method args. -
getEncryptedKeys
Extract all the EncryptedKey's from the SignableSimpleXMLObject.- Parameters:
sxo- the mock object to process- Returns:
- a list of EncryptedKey elements
-
generateList
@Nonnull private List<EncryptedKey> generateList(@Nonnull EncryptedData encData, @Nonnull EncryptedKeyResolver ekResolver, @Nullable Set<String> recipients) Resolve EncryptedKeys and put them in an ordered list.- Parameters:
encData- the EncryptedData contextekResolver- the resolver to testrecipients- the valid recipients for resolution- Returns:
- list of resolved EncryptedKeys
-