How to write a mockito test case for ResourceAssembler with in Spring Hateos?
问题 I am trying to write a unit test for the below Assembler but i keep getting Could not find current request via RequestContextHolder. Is this being called from a Spring MVC handler? . I wanted to know how i can mock out the resource creation? @Component public class LoginResourceAssembler extends ResourceAssemblerSupport<User, ResourceSupport> { public LoginResourceAssembler() { super(User.class, ResourceSupport.class); } @Override public ResourceSupport toResource(User user) { ResourceSupport