package test.at.gv.egovernment.moa.id.auth.builder; import test.at.gv.egovernment.moa.id.UnitTestCase; import at.gv.egovernment.moa.id.auth.builder.AuthenticationBlockAssertionBuilder; /** * @author Paul Ivancsics * @version $Id$ */ public class AuthenticationBlockAssertionBuilderTest extends UnitTestCase { private static final String nl = "\n"; private static final String ISSUER = "Hugo Mustermann"; private static final String ISSUE_INSTANT = "2003-03-15T22:50:21+01:00"; private static final String AUTH_URL = "https://auth.moa.gv.at/"; private static final String TARGET = "Grundbuch"; private static final String OA_URL = "https://grundbuch.gv.at/"; // wird auch von CreateXMLSignatureBuilderTest verwendet ! public static final String ASSERTION_SHOULD = "" + nl + " " + nl + " " + nl + " " + AUTH_URL + "" + nl + " " + nl + " " + nl + " " + TARGET + "" + nl + " " + nl + " " + nl + " " + OA_URL + "" + nl + " " + nl + " " + nl + ""; public AuthenticationBlockAssertionBuilderTest(String name) { super(name); } public void testBuild() throws Exception { AuthenticationBlockAssertionBuilder builder = new AuthenticationBlockAssertionBuilder(); String assertionBuilt = builder.build(ISSUER, ISSUE_INSTANT, AUTH_URL, TARGET, OA_URL); assertionBuilt = XML_DECL + assertionBuilt; String assertionShould = XML_DECL + ASSERTION_SHOULD; assertXmlEquals(assertionShould, assertionBuilt); } }