@Test public void testOnMouseDown() { tested.onMouseDown(); verify(mouseDownEvent, times(1)).fire(any(CanvasMouseDownEvent.class)); }
@Test public void testOnAddProviderType() { presenter.onAddProviderType(); verify(addNewProviderTypeEvent, times(1)).fire(any(AddNewProviderTypeEvent.class)); } }
@Test public void testCreateDriverEvent( ) { eventHelper.fireCreateEvent( newDriver ); verify( newDriverEvent, times( 1 ) ).fire( newDriver ); }
@Test public void cancelRequestTest() { presenter.cancelRequest(REQUESTID_ID); verify( requestChangedEvent, times( 1 ) ).fire(any(RequestChangedEvent.class)); verify(executorServiceMock).cancelRequest(REQUESTID_ID); }
@Test public void checkEventFiredWhenMatchesResourceType() { final Path path = mock(Path.class); when(path.getFileName()).thenReturn("file." + resourceType.getSuffix()); helper.postProcess(path); verify(invalidateDMOPackageCache, times(1)).fire(any(InvalidateDMOPackageCacheEvent.class)); }
@Before public void setup() { when(filterSettingsManager.createFilterSettingsPrototype()).thenReturn(filterSettingsMock); doNothing().when(savedFilterEvent).fire(any()); doNothing().when(notificationEvent).fire(any()); presenter = spy(AdvancedFiltersPresenter.class); presenter.setFilterSettingsManager(filterSettingsManager); presenter.setAdvancedFilterEditorView(advancedFilterEditorView); presenter.setSavedFilterSelectedEvent(savedFilterEvent); presenter.setNotificationEvent(notificationEvent); presenter.setPlaceManager(placeManagerMock); }
@Test public void testAddEntry() throws Exception { presenter.addEntry(); assertEquals(1, presenter.getValue().size()); verify( valueChangeEvent, times( 1 ) ).fire(any(ValueChangeEvent.class)); assertSetViewValue(1); }
@Test public void testActivateBusinessView() throws Exception { verify( changedEvent, never() ).fire( any( ActiveOptionsChangedEvent.class ) ); options.activateBusinessView(); verify( changedEvent ).fire( any( ActiveOptionsChangedEvent.class ) ); assertTrue( options.isBusinessViewActive() ); assertFalse( options.isTechnicalViewActive() ); }
@Test public void testOnPlaceGainFocusEvent() { PlaceGainFocusEvent event = new PlaceGainFocusEvent(placeRequest); tested.showDiagramEditorDocks(event); verify(onDiagramFocusEvent).fire(any(OnDiagramFocusEvent.class)); }
@Test public void testOnRefresh() { presenter.onRefresh(); verify(refreshRuntimeEvent, times(1)).fire(new RefreshRuntimeEvent(providerKey)); } }
@Test public void notifyLockError() throws Exception { lockManager.acquireLockOnDemand(); simulateLockError(); simulateLockDemand(); verify(lockNotification, times(1)).fire(any(NotificationEvent.class)); }
@Test public void testOnValidateFailed() { when(editWorkflow.hasErrors()).thenReturn(true); presenter.getValidateCommand().execute(); verify(editWorkflow, times(1)).flush(); final ArgumentCaptor<NotificationEvent> dataCaptor = ArgumentCaptor.forClass(NotificationEvent.class); verify(notification, times(1)).fire(dataCaptor.capture()); NotificationEvent ne = dataCaptor.getValue(); assertNotNull(ne); assertEquals(NotificationEvent.NotificationType.ERROR, ne.getType()); }
@Test public void testDeletePipelineExecution() { PipelineExecutionTraceKey pipelineExecutionTraceKey = new PipelineExecutionTraceKey(PIPELINE_EXECUTION_ID); service.deletePipelineExecution(pipelineExecutionTraceKey); verify(pipelineService, times(1)).deletePipelineExecution(PIPELINE_EXECUTION_ID); verify(pipelineExecutionChangeEvent, times(1)).fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.DELETED, pipelineExecutionTraceKey)); }
@Test public void testAfterStageExecution() { listener.afterStageExecution(new AfterStageExecutionEvent(EXECUTION_ID, pipeline, stage)); verify(stageStatusChangeEvent, times(1)).fire(new StageStatusChangeEvent(traceKey, STAGE_NAME, PipelineStatus.FINISHED)); }
@Test public void testNoUpdateWhenNoActiveModule() throws Exception { context.onModuleUpdated(new ModuleUpdatedEvent(getMockModule(), getMockModule())); verify(changeEvent, never()).fire(any()); }
@Test public void testCreateOUEvent() { presenter.createNewOrganizationalUnit(mockOU.getName(), mockOU.getOwner(), mockOU.getDefaultGroupId()); verify(createOUEvent, times(1)).fire(any(AfterCreateOrganizationalUnitEvent.class)); }
@Test public void onViewAlertsSendMessage() { screen.onTestRun(createTRMWithFailures()); screen.onViewAlerts(); verify(event).fire(publishEventCaptor.capture()); final PublishBatchMessagesEvent value = publishEventCaptor.getValue(); assertFalse(value.getMessagesToPublish().isEmpty()); }
@Test public void checkRemoveImportSortsAlphabetically() { view.makeRemoveImportCommand().execute(import2); verify(lockRequired).fire(any(LockRequiredEvent.class)); final List<Import> imports = view.getDataProvider().getList(); assertEquals(2, imports.size()); assertEquals(import3, imports.get(0)); assertEquals(import1, imports.get(1)); }
@Test public void testDisplaySuccessMessage() { presenter.displaySuccessMessage().catch_(i -> { fail("Promise should've been resolved!"); return promises.resolve(); }); verify(view).hideBusyIndicator(); verify(notificationEvent).fire(any()); }