Refactoring to @AutoWired, Testing added with mock database