Skip to content

Commit

Permalink
rearrange tests
Browse files Browse the repository at this point in the history
  • Loading branch information
escherize committed Apr 26, 2024
1 parent b680a8e commit 98990c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
22 changes: 5 additions & 17 deletions test/saml20_clj/sp/request_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -202,28 +202,16 @@
:idp-url "http://idp.example.com/SSOService.php"
:issuer "http://sp.example.com/demo1/metadata.php"}))]
(is (= [:samlp:LogoutRequest
{:xmlns:samlp "urn:oasis:names:tc:SAML:2.0:protocol"
{:xmlns "urn:oasis:names:tc:SAML:2.0:protocol"
:xmlns:samlp "urn:oasis:names:tc:SAML:2.0:protocol"
:xmlns:saml "urn:oasis:names:tc:SAML:2.0:assertion"
:Version "2.0"
:ID "ONELOGIN_109707f0030a5d00620c9d9df97f627afe9dcc24"
:IssueInstant "2020-09-24T22:51:00Z"
:Destination "http://idp.example.com/SSOService.php"}
[:saml:Issuer "http://sp.example.com/demo1/metadata.php"]
[:saml:NameID {:Format "urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress"} "[email protected]"]
[:samlp:SessionIndex "SessionIndex_From_Authentication_Assertion"]]
logout-xml))
(is (= (str "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "\n"
"<samlp:LogoutRequest Destination=\"http://idp.example.com/SSOService.php\" "
"ID=\"ONELOGIN_109707f0030a5d00620c9d9df97f627afe9dcc24\" "
"IssueInstant=\"2020-09-24T22:51:00Z\" "
"Version=\"2.0\" "
"xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\" "
"xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\">"
"<saml:Issuer>http://sp.example.com/demo1/metadata.php</saml:Issuer>"
"<saml:NameID Format=\"urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress\">[email protected]</saml:NameID>"
"<samlp:SessionIndex>SessionIndex_From_Authentication_Assertion</samlp:SessionIndex>"
"</samlp:LogoutRequest>")
(coerce/->xml-string logout-xml)))))
[:Issuer "http://sp.example.com/demo1/metadata.php"]
[:NameID {:Format "urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress"} "[email protected]"]]
logout-xml))))

(t/with-clock (t/mock-clock (t/instant "2020-09-24T22:51:00.000Z"))
(request/logout-redirect-location
Expand Down
2 changes: 1 addition & 1 deletion test/saml20_clj/sp/response_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
(testing (str "\noriginal =\n" (coerce/->xml-string original))
(testing (str "decrypted =\n" (coerce/->xml-string decrypted))
(prn :original (coerce/->xml-string original))
(prn :descrypted (coerce/->xml-string decrypted))
(prn :decrypted (coerce/->xml-string decrypted))
(is (= 0
(count (.getEncryptedAssertions decrypted))))
(is (= 1
Expand Down

0 comments on commit 98990c2

Please sign in to comment.