@Test(expected = BadFetchError.class)
public void testGetInvalidDocument() throws Exception, JVoiceXMLEvent {

    final String str = "<vxml><form><block><prompt>test</prompt>"
            + "</block></form></vxml>";
    final StringReader reader = new StringReader(str);
    final InputSource input = new InputSource(reader);
    final VoiceXmlDocument document = new VoiceXmlDocument(input);
    final URI uri = map.getUri("/test");
    map.addDocument(uri, document);
    final DocumentDescriptor descriptor = new DocumentDescriptor(uri);
    final Session session = Mockito.mock(Session.class);
    Mockito.when(session.getSessionId()).thenReturn(
            UUID.randomUUID().toString());
    final String sessionId = session.getSessionId();
    final VoiceXmlDocument retrievedDocument = server.getDocument(
            sessionId, descriptor);
    Assert.assertEquals(document, retrievedDocument);
}