@Before public void setUp() { when(appContext.getWorkspaceId()).thenReturn(WORKSPACE_ID); when(machineService.getMachines(anyString())).thenReturn(machinesPromise); when(machineService.getMachine(anyString())).thenReturn(machinePromise); when(machinePromise.then(Matchers.<Operation<MachineDto>>anyObject())) .thenReturn(machinePromise); when(machineService.getProcesses(anyString())).thenReturn(processesPromise); when(processesPromise.then(Matchers.<Operation<List<MachineProcessDto>>>anyObject())) .thenReturn(processesPromise); presenter = new ConsolesPanelPresenter( view, eventBus, dtoFactory, dialogFactory, entityFactory, terminalFactory, commandConsoleFactory, commandTypeRegistry, workspaceAgent, notificationManager, localizationConstant, machineService, resources, appContext); }