diff options
author | tkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2013-12-13 01:26:39 +0000 |
---|---|---|
committer | tkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2013-12-13 01:26:39 +0000 |
commit | d311d0f7b7ef9ed5bc383d6744b7d61239aafbc1 (patch) | |
tree | b48a211d1a907ad7af72027b2b2709ecd540b27c /STALService/src/test/java | |
parent | 8d597612c69c77982c981f711f549bc826b06fd8 (diff) | |
download | mocca-d311d0f7b7ef9ed5bc383d6744b7d61239aafbc1.tar.gz mocca-d311d0f7b7ef9ed5bc383d6744b7d61239aafbc1.tar.bz2 mocca-d311d0f7b7ef9ed5bc383d6744b7d61239aafbc1.zip |
Extend STAL to support CMS SignedAttributes
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1262 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'STALService/src/test/java')
-rw-r--r-- | STALService/src/test/java/at/gv/egiz/stal/service/translator/STALTranslatorTest.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/STALService/src/test/java/at/gv/egiz/stal/service/translator/STALTranslatorTest.java b/STALService/src/test/java/at/gv/egiz/stal/service/translator/STALTranslatorTest.java index 8331c993..98d301a7 100644 --- a/STALService/src/test/java/at/gv/egiz/stal/service/translator/STALTranslatorTest.java +++ b/STALService/src/test/java/at/gv/egiz/stal/service/translator/STALTranslatorTest.java @@ -28,6 +28,7 @@ package at.gv.egiz.stal.service.translator; import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; import at.gv.egiz.stal.SignRequest; +import at.gv.egiz.stal.SignRequest.SignedInfo; import at.gv.egiz.stal.service.translator.STALTranslator.TranslationHandler; import at.gv.egiz.stal.service.types.ObjectFactory; import at.gv.egiz.stal.service.types.RequestType; @@ -94,13 +95,17 @@ public class STALTranslatorTest { System.out.println("translate"); SignRequest request = new SignRequest(); request.setKeyIdentifier("kid"); - request.setSignedInfo("signedinfo".getBytes()); + SignedInfo signedInfo = new SignedInfo(); + signedInfo.setValue("signedinfo".getBytes()); + request.setSignedInfo(signedInfo); STALTranslator instance = new STALTranslator(); JAXBElement<? extends RequestType> result = instance.translate(request); assertEquals(SignRequestType.class, result.getValue().getClass()); SignRequestType resultT = (SignRequestType) result.getValue(); assertEquals(request.getKeyIdentifier(), resultT.getKeyIdentifier()); - assertEquals(request.getSignedInfo(), resultT.getSignedInfo()); + assertEquals(request.getSignedInfo().getValue(), resultT.getSignedInfo().getValue()); + assertEquals(request.getSignedInfo().isIsCMSSignedAttributes(), resultT.getSignedInfo().isIsCMSSignedAttributes()); + assertEquals(request.getSignatureMethod(), resultT.getSignatureMethod()); } /** @@ -111,13 +116,18 @@ public class STALTranslatorTest { System.out.println("translate"); SignRequestType req = of.createSignRequestType(); req.setKeyIdentifier("kid"); - req.setSignedInfo("signedinfo".getBytes()); + SignRequestType.SignedInfo signedInfo = of.createSignRequestTypeSignedInfo(); + signedInfo.setValue("signedinfo".getBytes()); + req.setSignedInfo(signedInfo); + req.setSignatureMethod("signatureMethod"); JAXBElement<? extends RequestType> request = of.createGetNextRequestResponseTypeSignRequest(req); STALTranslator instance = new STALTranslator(); STALRequest result = instance.translateWSRequest(request); assertEquals(SignRequest.class, result.getClass()); assertEquals(req.getKeyIdentifier(), ((SignRequest) result).getKeyIdentifier()); - assertEquals(req.getSignedInfo(), ((SignRequest) result).getSignedInfo()); + assertEquals(req.getSignedInfo().getValue(), ((SignRequest) result).getSignedInfo().getValue()); + assertEquals(req.getSignedInfo().isIsCMSSignedAttributes(), ((SignRequest) result).getSignedInfo().isIsCMSSignedAttributes()); + assertEquals(req.getSignatureMethod(), ((SignRequest) result).getSignatureMethod()); } @Test(expected=RuntimeException.class) |