Writing code for application tests is like writing code for any other part of a Spring application. You can make use of components and services as you would in any other part of your application. Let us demonstrate this, shall we?
Add the following TestUserService interface to com.example.placereviewer.service:
package com.example.placereviewer.serviceimport com.example.placereviewer.data.model.Userinterface TestUserService { fun getUser(): User}
Now, add the following TestUserServiceImpl class to the package:
package com.example.placereviewer.serviceimport com.example.placereviewer.data.model.Userimport org.springframework.stereotype.Service@Serviceinternal class TestUserServiceImpl : TestUserService { //Test stub ...