1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.core.provisioning.api;
20
21 import static org.junit.jupiter.api.Assertions.assertEquals;
22 import static org.junit.jupiter.api.Assertions.assertFalse;
23 import static org.junit.jupiter.api.Assertions.assertTrue;
24
25 import java.util.HashSet;
26 import java.util.Set;
27 import org.junit.jupiter.api.Test;
28 import org.mockito.Mock;
29
30 public class WorkflowResultTest extends AbstractTest {
31
32 @Test
33 public void test(final @Mock PropagationByResource<String> propByRes) {
34 String result = "result";
35 Set<String> performedTasks = new HashSet<>();
36 performedTasks.add("TEST");
37 WorkflowResult<String> workflowResult = new WorkflowResult<>(result, propByRes, performedTasks);
38 WorkflowResult<String> workflowResult2 = new WorkflowResult<>(result, propByRes, performedTasks);
39
40 assertTrue(workflowResult.equals(workflowResult));
41 assertTrue(workflowResult.equals(workflowResult2));
42 assertFalse(workflowResult.equals(null));
43 assertFalse(workflowResult.equals(String.class));
44
45 result = "newResult";
46 workflowResult.setResult(result);
47 assertEquals(result, workflowResult.getResult());
48
49 assertEquals(propByRes, workflowResult2.getPropByRes());
50 }
51 }