I am trying to add a RepositoryEventHandler as described on Spring Data REST documentation to the REST repository shown below:
@RepositoryRestResource(collec
Sometimes obvious mistakes go unnoticed.
POST-ing a Spring Data REST resource, emits a BeforeCreateEvent. To catch this event, the method handleBeforeSave must be annotated with @HandleBeforeCreate instead of @HandleBeforeSave (the latter gets invoked on PUT and PATCH HTTP calls).
Tests pass successfully on my (cleaned up) demo app now.