Rewrite the autowired test for trash manager and various changes per feedback