SecurityPoliciesProcessInstanceRestrictionApplier implements SecurityPoliciesRestrictionApplier<GetProcessInstancesPayload> { @Override public GetProcessInstancesPayload restrictToKeys(Set<String> keys) { return ProcessPayloadBuilder.processInstances().withProcessDefinitionKeys(keys).build(); }  @Override GetProcessInstancesPayload restrictToKeys(Set<String> keys); @Override GetProcessInstancesPayload denyAll(); @Override GetProcessInstancesPayload allowAll();  }
@Test public void restrictToKeysAddFilterOnGivenKeys() { Set<String> keys = Collections.singleton("procDef"); GetProcessInstancesPayload filter = restrictionApplier.restrictToKeys(keys); assertThat(filter.getProcessDefinitionKeys()).isEqualTo(keys); }