I’m new to Java programming and I have the following snippet on which I want to write unit test: I’m able to create the scenario where HTTP request returns a valid response using the below code: I want to create another scenario where the method call response.readEntity(type) throws an exception. For this, I require that request.get() method returns me a