When I am running test at that time @Autowired is working but when I run the web app and try to fetch data at that time its throwing null pointer exception.
You have to wire a interface instead of class. so there are two ways:
To let BuyerRepo to implement one interface
Useing @Inject or @Resource instead of @Autowired