OperationAuthoriser implements GraphHook { @JsonIgnore public Set<String> getAllAuths() { return Collections.unmodifiableSet(allAuths); }  @Override void preExecute(final OperationChain<?> opChain, final Context context); @Override T postExecute(final T result, final OperationChain<?> opChain, final Context context); @Override T onFailure(final T result, final OperationChain<?> opChain, final Context context, final Exception e); void addAuths(final Class<? extends Operation> opClass, final String... auths); @JsonIgnore Map<Class<?>, Set<String>> getAuths(); @JsonIgnore void setAuths(final Map<Class<?>, Set<String>> auths); @JsonGetter("auths") Map<String, Set<String>> getAuthsAsStrings(); @JsonSetter("auths") void setAuthsFromStrings(final Map<String, Set<String>> auths); @JsonIgnore Set<String> getAllAuths();  }
@Test public void shouldReturnAllOpAuths() { final OperationAuthoriser hook = fromJson(OP_AUTHS_PATH); final Set<String> allOpAuths = hook.getAllAuths(); assertThat(allOpAuths, IsCollectionContaining.hasItems("User", "ReadUser", "WriteUser", "SuperUser", "AdminUser")); }