Tuesday, August 23, 2022

Mocking a method which returns Page interface

Mocking a method which returns Page interface

	private PostRepository postRepository;
	private PostService postService;
	void getAllPostByTitelTest(){
		List<Post> post = new ArrayList<>();
		Post post = new Post();
		Page<Post> pagedResponse = new PageImpl(post);
		List<Post> posts = postService.getAllPostByTitel(title);

Related Post 
Spring Boot pagination - Mockito repository
How to deal with Page while unit testing with mockito and Junit
How to mock Page with content data in Unit Test?
How to Mock Pageable object using Mockito?

No comments:

Post a Comment