@@ -716,31 +716,12 @@ public void testGetIssuers() throws IOException, Error, XPathExpressionException
716716 samlResponseEncoded = Util .getFileAsString ("data/responses/signed_assertion_response.xml.base64" );
717717 samlResponse = new SamlResponse (settings , newHttpRequest (samlResponseEncoded ));
718718 assertEquals (expectedIssuers , samlResponse .getIssuers ());
719- }
720-
721- /**
722- * Tests the getIssuers method of SamlResponse
723- * Case: Issuer of the response not found
724- *
725- * @throws Error
726- * @throws IOException
727- * @throws ValidationError
728- * @throws SettingsException
729- * @throws SAXException
730- * @throws ParserConfigurationException
731- * @throws XPathExpressionException
732- *
733- * @see com.onelogin.saml2.authn.SamlResponse#getIssuers
734- */
735- @ Test
736- public void testGetIssuersNoInResponse () throws IOException , Error , XPathExpressionException , ParserConfigurationException , SAXException , SettingsException , ValidationError {
737- expectedEx .expect (ValidationError .class );
738- expectedEx .expectMessage ("Issuer of the Response not found or multiple." );
739719
740- Saml2Settings settings = new SettingsBuilder ().fromFile ("config/config.my.properties" ).build ();
741- String samlResponseEncoded = Util .getFileAsString ("data/responses/invalids/no_issuer_response.xml.base64" );
742- SamlResponse samlResponse = new SamlResponse (settings , newHttpRequest (samlResponseEncoded ));
743- List <String > issuers = samlResponse .getIssuers ();
720+ expectedIssuers = new ArrayList <String >();
721+ expectedIssuers .add ("https://app.onelogin.com/saml/metadata/13590" );
722+ samlResponseEncoded = Util .getFileAsString ("data/responses/invalids/no_issuer_response.xml.base64" );
723+ samlResponse = new SamlResponse (settings , newHttpRequest (samlResponseEncoded ));
724+ assertEquals (expectedIssuers , samlResponse .getIssuers ());
744725 }
745726
746727 /**
@@ -1630,7 +1611,7 @@ public void testIsInValidIssuer() throws IOException, Error, XPathExpressionExce
16301611 settings .setStrict (true );
16311612 samlResponse = new SamlResponse (settings , newHttpRequest (samlResponseEncoded ));
16321613 assertFalse (samlResponse .isValid ());
1633- assertEquals ("Invalid issuer in the Assertion/ Response" , samlResponse .getError ());
1614+ assertEquals ("No Signature found. SAML Response rejected " , samlResponse .getError ());
16341615
16351616 }
16361617
0 commit comments