Search in sources :

Example 1 with ConversationService

use of org.apache.webbeans.spi.ConversationService in project tomee by apache.

the class StatefulConversationScopedTOMEE1138Test method startConversation.

@Before
public void startConversation() {
    final WebBeansContext webBeansContext = WebBeansContext.currentInstance();
    webBeansContext.registerService(ConversationService.class, new ConversationService() {

        @Override
        public String getConversationId() {
            return "conversation-test";
        }

        @Override
        public String generateConversationId() {
            return "cid_1";
        }
    });
    webBeansContext.getService(ContextsService.class).startContext(ConversationScoped.class, null);
}
Also used : ContextsService(org.apache.webbeans.spi.ContextsService) WebBeansContext(org.apache.webbeans.config.WebBeansContext) ConversationService(org.apache.webbeans.spi.ConversationService) Before(org.junit.Before)

Aggregations

WebBeansContext (org.apache.webbeans.config.WebBeansContext)1 ContextsService (org.apache.webbeans.spi.ContextsService)1 ConversationService (org.apache.webbeans.spi.ConversationService)1 Before (org.junit.Before)1