Batch batch = mock(Batch.class);
SessionConfig config = mock(SessionConfig.class);
Session<LocalSessionContext> session = mock(Session.class);
String sessionId = "session";
when(config.findSessionId(exchange)).thenReturn(sessionId);
when(this.manager.containsSession(sessionId)).thenReturn(false);
when(this.manager.createSession(sessionId)).thenReturn(session);
when(this.manager.getBatcher()).thenReturn(batcher);
when(batcher.createBatch()).thenReturn(batch);
when(session.getId()).thenReturn(sessionId);