[java-plugin-shibd] branch main updated: Adjust flow test helper method to rely only on response body.
Scott Cantor
cantor.2 at osu.edu
Mon Aug 5 14:52:49 UTC 2024
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-plugin-shibd.
View the commit online:
http://git.shibboleth.net/view/?p=java-plugin-shibd.git;a=commit;h=ae46d778b04ac6f4c9d6462f5bb649ec1f2c31cf
The following commit(s) were added to refs/heads/main by this push:
new ae46d77 Adjust flow test helper method to rely only on response body.
ae46d77 is described below
commit ae46d778b04ac6f4c9d6462f5bb649ec1f2c31cf
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Aug 5 10:52:46 2024 -0400
Adjust flow test helper method to rely only on response body.
---
.../net/shibboleth/sp/flows/AbstractSPFlowTest.java | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/sp-conf-impl/src/test/java/net/shibboleth/sp/flows/AbstractSPFlowTest.java b/sp-conf-impl/src/test/java/net/shibboleth/sp/flows/AbstractSPFlowTest.java
index 12f4492..8c7da46 100644
--- a/sp-conf-impl/src/test/java/net/shibboleth/sp/flows/AbstractSPFlowTest.java
+++ b/sp-conf-impl/src/test/java/net/shibboleth/sp/flows/AbstractSPFlowTest.java
@@ -28,7 +28,6 @@ import javax.annotation.Nullable;
import org.apache.commons.codec.binary.Base64;
import org.opensaml.messaging.context.MessageContext;
import org.opensaml.messaging.decoder.MessageDecodingException;
-import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.saml.common.SAMLObject;
import org.opensaml.saml.saml2.binding.decoding.impl.HTTPRedirectDeflateDecoder;
import org.springframework.beans.factory.annotation.Autowired;
@@ -48,7 +47,6 @@ import net.shibboleth.shared.net.URISupport;
import net.shibboleth.shared.primitive.NonnullSupplier;
import net.shibboleth.shared.servlet.impl.HttpServletRequestResponseContext;
import net.shibboleth.shared.xml.ParserPool;
-import net.shibboleth.sp.context.AgentRequestContext;
import net.shibboleth.sp.ddf.DDF;
import net.shibboleth.sp.profile.impl.ResolveApplication;
@@ -173,24 +171,16 @@ public abstract class AbstractSPFlowTest extends AbstractFlowTest {
* @return output object
*/
@Nullable protected DDF assertOutputMessageEvent(@Nonnull final FlowExecutionResult result, @Nullable final String eventId) {
- final ProfileRequestContext prc = retrieveProfileRequestContext(result);
- assert prc != null;
- final AgentRequestContext arc = prc.ensureSubcontext(AgentRequestContext.class);
- final DDF output = arc.getOutput();
-
- if (eventId != null) {
- assert output != null;
- Assert.assertTrue(output.isstruct());
- Assert.assertEquals(output.getmember(EVENT_MEMBER_NAME).string(), eventId);
- } else {
- Assert.assertTrue(output == null || !output.isstruct() || output.getmember(EVENT_MEMBER_NAME).isnull());
- }
Assert.assertEquals(response.getContentType(), "text/plain");
final byte[] body = response.getContentAsByteArray();
if (body == null || body.length == 0) {
- return null;
+ if (eventId != null) {
+ Assert.fail("No response body");
+ } else {
+ return null;
+ }
}
try (final InputStream in = new ByteArrayInputStream(body)) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list