@Test public void actionWithNoBaseUri() {

    String html = "<form><input name='q'></form>";
    Document doc = Jsoup.parse(html);
    FormElement form = ((FormElement) doc.select("form").first());
    boolean threw = false;
    try {
        Connection con = form.submit();
    } catch (IllegalArgumentException e) {
        threw = true;
        assertEquals("Could not determine a form action URL for submit. Ensure you set a base URI when parsing.",
                e.getMessage());
    }
    assertTrue(threw);
}