OperationAuthoriser implements GraphHook { @Override public <T> T postExecute(final T result, final OperationChain<?> opChain, final Context context) { return result; }  @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 shouldReturnResultWithoutModification() { final OperationAuthoriser hook = fromJson(OP_AUTHS_PATH); final Object result = mock(Object.class); final OperationChain opChain = new OperationChain.Builder() .first(new GenerateObjects<>()) .build(); final User user = new User.Builder() .opAuths("NoScore") .build(); final Object returnedResult = hook.postExecute(result, opChain, new Context(user)); assertSame(result, returnedResult); }