@Test(groups = {INTEGRATION, ASYNC_SERVLET})
@SpecAssertions({ @SpecAssertion(section = CONVERSATION_CONTEXT, id = "da"), @SpecAssertion(section = CONVERSATION_CONTEXT, id = "db"),
@SpecAssertion(section = CONVERSATION_CONTEXT, id = "dc"), @SpecAssertion(section = CONVERSATION_CONTEXT, id = "dd") })
public void testConversationDetermination() throws Exception {
WebClient webClient = new WebClient();
webClient.setThrowExceptionOnFailingStatusCode(true);
// Begin long-running conversation
TextPage cidPage = webClient.getPage(contextPath + "foo?action=begin");
String cid = cidPage.getContent().substring(cidPage.getContent().indexOf("cid: [") + 6,
cidPage.getContent().indexOf("]"));
assertTrue(cidPage.getContent().contains("transient: false"));
// Test built-in conversation bean is available
TextPage resultPage = webClient.getPage(contextPath + "foo?action=test&cid=" + cid.trim());
assertTrue(resultPage.getContent().contains("testServlet=true"));
assertTrue(resultPage.getContent().contains("testFilter=true"));
assertTrue(resultPage.getContent().contains("testListener=true"));
// Async listener
resultPage = webClient.getPage(contextPath + "foo-async?action=test&cid=" + cid.trim());
assertTrue(resultPage.getContent().contains("testAsyncListener=true"));
}