MockControl sessionCtrl = MockControl.createControl(Session.class);
Session session = (Session) sessionCtrl.getMock();
MockControl wsCtrl = MockControl.createControl(Workspace.class);
Workspace ws = (Workspace) wsCtrl.getMock();
MockControl omCtrl = MockControl.createControl(ObservationManager.class);
ObservationManager oManager = (ObservationManager) omCtrl.getMock();
repoCtrl.expectAndReturn(repo.login(null, null), session);
sessionCtrl.expectAndReturn(session.getWorkspace(), ws);
wsCtrl.expectAndReturn(ws.getObservationManager(), oManager);
oManager.addEventListener(def1.getListener(), def1.getEventTypes(), def1.getAbsPath(), def1.isDeep(), def1
.getUuid(), def1.getNodeTypeName(), def1.isNoLocal());
oManager.addEventListener(def2.getListener(), def2.getEventTypes(), def2.getAbsPath(), def2.isDeep(), def2
.getUuid(), def2.getNodeTypeName(), def2.isNoLocal());