Class ChainingEncryptedKeyResolverTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.encryption.support.ChainingEncryptedKeyResolverTest
-
public class ChainingEncryptedKeyResolverTest extends XMLObjectBaseTestCase
Test the encrypted key resolver which dereferences RetrievalMethods.
-
-
Field Summary
Fields Modifier and Type Field Description private Set<String>recipientsprivate ChainingEncryptedKeyResolverresolverThe resolver instance to be tested.private List<EncryptedKeyResolver>resolverChain-
Fields inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory
-
-
Constructor Summary
Constructors Constructor Description ChainingEncryptedKeyResolverTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private List<EncryptedKey>generateList(EncryptedData encData, EncryptedKeyResolver ekResolver)Resolve EncryptedKeys and put them in an ordered list.private List<EncryptedKey>getEncryptedKeys(SignableSimpleXMLObject sxo)Extract all the EncryptedKey's from the SignableSimpleXMLObject.protected voidsetUp()voidtestEmptyChain()Test error case of empty resolver chain.voidtestMultiEKWithOneRecipient()One recipient specified to resolver, EncryptedKeys in instance inline and via RetrievalMethod .voidtestMultiEKWithTwoRecipients()Two recipients specified to resolver, EncryptedKeys in instance inline and via RetrievalMethod .voidtestSingleEKInline()One recipient specified to resolver, EncryptedKey in instance inline.voidtestSingleEKRetrievalMethod()One recipient specified to resolver, EncryptedKey in instance via RetrievalMethod .-
Methods inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElement
-
Methods inherited from class org.opensaml.core.OpenSAMLInitBaseTestCase
initOpenSAML
-
-
-
-
Field Detail
-
resolver
private ChainingEncryptedKeyResolver resolver
The resolver instance to be tested.
-
resolverChain
private List<EncryptedKeyResolver> resolverChain
-
-
Method Detail
-
setUp
@BeforeMethod protected void setUp() throws Exception
- 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 .
-
getEncryptedKeys
private List<EncryptedKey> getEncryptedKeys(SignableSimpleXMLObject sxo)
Extract all the EncryptedKey's from the SignableSimpleXMLObject.- Parameters:
sxo- the mock object to process- Returns:
- a list of EncryptedKey elements
-
generateList
private List<EncryptedKey> generateList(EncryptedData encData, EncryptedKeyResolver ekResolver)
Resolve EncryptedKeys and put them in an ordered list.- Parameters:
encData- the EncryptedData contextekResolver- the resolver to test- Returns:
- list of resolved EncryptedKeys
-
-