Updating token cache tests and adding new notification BeforeWrite