@Test
public void testDecode() throws IOException, SAXException {

    ServletInputStream input = new ServletInputStreamMock("<body rid='3549788615' xmlns='http://jabber.org/protocol/httpbind' to='vysper.org' xml:lang='en' wait='60' hold='1' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>");
    expect(request.getInputStream()).andReturn(input);
    Capture<Stanza> captured = new Capture<Stanza>();
    boshHandler.process(EasyMock.<HttpServletRequest>notNull(), EasyMock.<Stanza>capture(captured));
    mocksControl.replay();
    boshDecoder.decode();
    mocksControl.verify();
    Stanza request = captured.getValue();
    assertNotNull(request);
    assertEquals("body", request.getName());
    assertEquals(NamespaceURIs.XEP0124_BOSH, request.getNamespaceURI());
    assertEquals("3549788615", request.getAttributeValue("rid"));
    assertEquals("vysper.org", request.getAttributeValue("to"));
    assertEquals("60", request.getAttributeValue("wait"));
    assertEquals("1", request.getAttributeValue("hold"));
    assertEquals("1.6", request.getAttributeValue("ver"));
    assertEquals("1.0", request.getAttributeValue(NamespaceURIs.URN_XMPP_XBOSH, "version"));
    assertEquals("en", request.getAttributeValue(NamespaceURIs.XML, "lang"));
}