In Mockito, the _____ method can be used to stub a return value for a method call.
- mock
- spy
- verify
- when
In Mockito, the when method is used to stub a return value for a method call. This allows you to define the behavior of a mocked object when a specific method is called during testing.
Loading...
Related Quiz
- How can the use of HTTP/2 in a Spring Boot application improve its performance?
- You need to develop a Spring Boot application where the requirement is to have different request mappings based on the user's role. How would you design the request mappings and controller methods to fulfill this requirement?
- Explain how to secure service-to-service communication in a Spring Cloud environment using Spring Security.
- When creating a Custom Validator in Spring Boot, the isValid method must return _____ to indicate whether the value meets the constraint.
- When dealing with relationships in Spring Data JPA, the _____ annotation can be used to handle cascading operations between entities.