ExternalContextHolder.setExternalContext(externalContext);
Conversation conversation = conversationManager.beginConversation(new ConversationParameters("test", "test",
"test"));
conversation.lock();
conversation.putAttribute("testAttribute", "testValue");
ConversationId conversationId = conversation.getId();
ExternalContextHolder.setExternalContext(null);
// simulate write out of session
byte[] passiveSession = passivate(externalContext.getSessionMap());
// simulate start-up of server
conversationManager = new SessionBindingConversationManager();
String id = conversationId.toString();
conversationId = conversationManager.parseConversationId(id);
// simulate restore of session
externalContext.setSessionMap(activate(passiveSession));
ExternalContextHolder.setExternalContext(externalContext);