public static RedirectionAction buildFormPostContentAction(final WebContext context, final String content) {
        // is this an automatic form post generated by OpenSAML?
        if (content != null && content.contains("onload=\"document.forms[0].submit()\"")) {
            val url = StringEscapeUtils.unescapeHtml4(substringBetween(content, "<form action=\"", "\" method=\"post\">"));
            if (isNotBlank(url)) {
                val data = new HashMap<String, String>();
                val samlRequest = StringEscapeUtils.unescapeHtml4(substringBetween(content, "name=\"SAMLRequest\" value=\"", "\"/>"));
                if (isNotBlank(samlRequest)) {
                    data.put("SAMLRequest", samlRequest);
                }
                val relayState = StringEscapeUtils.unescapeHtml4(substringBetween(content, "name=\"RelayState\" value=\"", "\"/>"));
                if (isNotBlank(relayState)) {
                    data.put("RelayState", relayState);
                }
                val samlResponse = StringEscapeUtils.unescapeHtml4(substringBetween(content, "name=\"SAMLResponse\" value=\"", "\"/>"));
                if (isNotBlank(samlResponse)) {
                    data.put("SAMLResponse", samlResponse);
                }
                return new AutomaticFormPostAction(url, data, content);
            }
        }
        return new OkAction(content);
    }
@Test
    public void testFormPostContentAction() {
        val action = HttpActionHelper.buildFormPostContentAction(MockWebContext.create(), VALUE);
        assertTrue(action instanceof OkAction);
        assertFalse(action instanceof AutomaticFormPostAction);
        assertEquals(VALUE, ((OkAction) action).getContent());
    }