|
1 | 1 | package org.exoplatform.processes.storage;
|
2 | 2 |
|
3 |
| -import org.apache.xmlbeans.impl.xb.xsdschema.Public; |
4 | 3 | import org.exoplatform.commons.exception.ObjectNotFoundException;
|
5 | 4 | import org.exoplatform.commons.file.model.FileInfo;
|
6 | 5 | import org.exoplatform.commons.file.model.FileItem;
|
7 | 6 | import org.exoplatform.commons.file.services.FileService;
|
8 |
| -import org.exoplatform.commons.file.services.FileStorageException; |
9 | 7 | import org.exoplatform.container.ExoContainerContext;
|
10 | 8 | import org.exoplatform.processes.Utils.EntityMapper;
|
11 | 9 | import org.exoplatform.processes.Utils.ProcessesUtils;
|
|
44 | 42 | import org.powermock.modules.junit4.PowerMockRunner;
|
45 | 43 |
|
46 | 44 | import javax.ws.rs.ext.RuntimeDelegate;
|
47 |
| -import java.io.IOException; |
48 | 45 | import java.util.*;
|
49 | 46 |
|
50 | 47 | import static org.junit.Assert.*;
|
@@ -189,6 +186,8 @@ public void saveWorkflow() {
|
189 | 186 | when(workFlow.getIllustrativeAttachment()).thenReturn(illustrativeAttachment);
|
190 | 187 | this.processesStorage.saveWorkFlow(workFlow, 1L);
|
191 | 188 | verify(workFlowDAO, times(1)).create(workFlowEntity);
|
| 189 | + PowerMockito.verifyStatic(ProcessesUtils.class, times(1)); |
| 190 | + ProcessesUtils.broadcast(listenerService, "exo.process.created", 1L, EntityMapper.fromEntity(workFlowEntity, illustrativeAttachment)); |
192 | 191 | verify(processesAttachmentService, times(1)).linkAttachmentsToEntity(attachments.toArray(new Attachment[0]),
|
193 | 192 | 1L,
|
194 | 193 | 1L,
|
@@ -255,8 +254,8 @@ public void saveWork() throws EntityNotFoundException, IllegalAccessException, O
|
255 | 254 | when(taskDto.getTitle()).thenReturn("");
|
256 | 255 | when(taskService.createTask(taskDto)).thenReturn(taskDto);
|
257 | 256 | processesStorage.saveWork(work, 1L);
|
258 |
| - PowerMockito.verifyStatic(NotificationUtils.class, times(1)); |
259 |
| - NotificationUtils.broadcast(listenerService, "exo.process.request.created", work, projectDto); |
| 257 | + PowerMockito.verifyStatic(ProcessesUtils.class, times(1)); |
| 258 | + ProcessesUtils.broadcast(listenerService, "exo.process.request.created", work, projectDto); |
260 | 259 |
|
261 | 260 | work.setIsDraft(true);
|
262 | 261 | work.setId(0);
|
@@ -285,8 +284,8 @@ public void saveWork() throws EntityNotFoundException, IllegalAccessException, O
|
285 | 284 | when(statusService.getStatuses(1L)).thenReturn(statuses);
|
286 | 285 | work.setStatus("Canceled");
|
287 | 286 | processesStorage.saveWork(work, 1L);
|
288 |
| - PowerMockito.verifyStatic(NotificationUtils.class, times(1)); |
289 |
| - NotificationUtils.broadcast(listenerService, "exo.process.request.canceled", updatedTask, updatedTask.getStatus().getProject()); |
| 287 | + PowerMockito.verifyStatic(ProcessesUtils.class, times(1)); |
| 288 | + ProcessesUtils.broadcast(listenerService, "exo.process.request.canceled", updatedTask, updatedTask.getStatus().getProject()); |
290 | 289 | verify(taskService, times(1)).updateTask(taskDto);
|
291 | 290 |
|
292 | 291 | when(taskService.getTask(work.getId())).thenThrow(EntityNotFoundException.class);
|
|
0 commit comments