i have a question regarding service layer testing in Spring framework. I have a class ProductService which has method:
public List<Product> getProducts() {
return productDAO.getProducts();
}
Is there any way to test it properly? This method retrieve all products using dao layer, when i, for example fill a list with five products(which are in database right now) and test this method by asserting size of the list it seems useless because when i add one product it still passes, but it shouldn't - after adding one product it should return 6 not 5 products... If you have any usefull sites/yt videos about spring unit testing please let me know. Thanks for Your help in advance! Regards