[java-identity-provider] branch main updated: Null cleanup in test.
Scott Cantor
cantor.2 at osu.edu
Fri Mar 31 16:10:48 UTC 2023
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=527eabbb1fe313fe961c7dd25b9fe9fae8788f7d
The following commit(s) were added to refs/heads/main by this push:
new 527eabbb1 Null cleanup in test.
527eabbb1 is described below
commit 527eabbb1fe313fe961c7dd25b9fe9fae8788f7d
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Mar 31 12:10:44 2023 -0400
Null cleanup in test.
---
.../flows/saml1/SAML1TestResponseValidator.java | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/saml1/SAML1TestResponseValidator.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/saml1/SAML1TestResponseValidator.java
index 79f8c5335..cbf1a850b 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/saml1/SAML1TestResponseValidator.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/saml1/SAML1TestResponseValidator.java
@@ -41,6 +41,7 @@ import org.opensaml.saml.saml1.core.NameIdentifier;
import org.opensaml.saml.saml1.core.Response;
import org.opensaml.saml.saml1.core.Status;
import org.opensaml.saml.saml1.core.StatusCode;
+import org.opensaml.saml.saml1.core.StatusMessage;
import org.opensaml.saml.saml1.core.Subject;
import org.opensaml.saml.saml1.core.SubjectConfirmation;
import org.testng.Assert;
@@ -217,12 +218,14 @@ public class SAML1TestResponseValidator {
final Subject attributeStatementSubject = attributeStatement.getSubject();
assertSubject(attributeStatementSubject);
+ assert attributeStatementSubject != null;
final NameIdentifier nameId = attributeStatementSubject.getNameIdentifier();
assertNameIdentifier(nameId);
final SubjectConfirmation subjectConfirmation = attributeStatementSubject.getSubjectConfirmation();
assertSubjectConfirmation(subjectConfirmation);
+ assert subjectConfirmation != null;
final List<ConfirmationMethod> confirmationMethods = subjectConfirmation.getConfirmationMethods();
assertConfirmationMethods(confirmationMethods);
@@ -243,8 +246,9 @@ public class SAML1TestResponseValidator {
*/
public void assertResponse(@Nullable final Response response) {
assert response!=null;
- Assert.assertNotNull(response.getID());
- Assert.assertFalse(response.getID().isEmpty());
+ final String id = response.getID();
+ assert id != null;
+ Assert.assertFalse(id.isEmpty());
Assert.assertNotNull(response.getIssueInstant());
Assert.assertEquals(response.getVersion(), SAMLVersion.VERSION_11);
}
@@ -262,10 +266,13 @@ public class SAML1TestResponseValidator {
*/
public void assertStatus(@Nullable final Status status) {
assert status!=null;
- Assert.assertNotNull(status.getStatusCode());
- Assert.assertEquals(status.getStatusCode().getValue(), statusCode);
+ final StatusCode codeObject = status.getStatusCode();
+ assert codeObject != null;
+ Assert.assertEquals(codeObject.getValue(), statusCode);
if (statusCode != StatusCode.SUCCESS) {
- Assert.assertEquals(status.getStatusMessage().getValue(), statusMessage);
+ final StatusMessage message = status.getStatusMessage();
+ assert message != null;
+ Assert.assertEquals(message.getValue(), statusMessage);
}
}
@@ -330,8 +337,9 @@ public class SAML1TestResponseValidator {
assert authenticationStatement!=null;
Assert.assertNotNull(authenticationStatement.getSubject());
Assert.assertNotNull(authenticationStatement.getAuthenticationInstant());
- Assert.assertNotNull(authenticationStatement.getAuthenticationMethod());
- Assert.assertFalse(authenticationStatement.getAuthenticationMethod().isEmpty());
+ final String method = authenticationStatement.getAuthenticationMethod();
+ assert method != null;
+ Assert.assertFalse(method.isEmpty());
}
/**
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list