1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| package jnpf.base.service;
|
| import org.junit.Test;
| import java.util.*;
| import static org.junit.Assert.*;
|
| public class FilePermissionNativeDraftTest {
| @Test public void ordinaryFormNeedsNativeIdentityAndExplicitPersistedState() {
| Map<String,Object> row = new HashMap<>(); row.put("id", "record"); row.put("flowTaskId", "record");
| assertFalse(FilePermissionNativeDraft.matches(row, "record", "record"));
| Map<String,Object> state = new HashMap<>(); state.put("flowId", null); state.put("flowState", null); state.put("deleteMark", null);
| row.put(FilePermissionNativeDraft.STATE_KEY, state);
| assertTrue(FilePermissionNativeDraft.matches(row, "record", "record"));
| assertFalse(FilePermissionNativeDraft.matches(row, "other", "record"));
| state.put("flowState", 1); assertFalse(FilePermissionNativeDraft.matches(row, "record", "record"));
| state.put("flowState", null); row.put("flowTaskId", "other-task");
| assertFalse(FilePermissionNativeDraft.matches(row, "record", "other-task"));
| }
| }
|
|