Skip to content
Advertisement

How do I mock RestTemplate exchange using junit 5 (Jupiter)

I tried with below code but in response body I got empty records.

Please help me on below code.

Java Code:

JavaScript

Test Code:

JavaScript

Advertisement

Answer

You need to set the value of customer in your response. The values you are setting in customer object is not being used anywhere. Try this:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement