As per clean code testing , you should the test the functionality , not the implementation.. To understand this better, let me give an example let’s say there is a service class which stores the vehicle details , by converting a list with single element.and using ‘saveAll()’ JPA repository method. …