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