encapsulated db jpa logic into dao object and added a sample test with mocked dao in the controller.