package jnpf.base.service; import org.junit.Test; import java.util.*; import static org.junit.Assert.*; public class FilePermissionNativeDraftTest { @Test public void ordinaryFormNeedsNativeIdentityAndExplicitPersistedState() { Map row = new HashMap<>(); row.put("id", "record"); row.put("flowTaskId", "record"); assertFalse(FilePermissionNativeDraft.matches(row, "record", "record")); Map 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")); } }