How to mock auth0 calls in unit testing to avoid calling the api to many times

We utilize the Springboot java framework and we have unit testing. We use Mockito and Unirest, however unit tests are called when someone builds - so we could end up calling auth0 100’s of times per day.
So we are trying to mock it.
To really check auth0 requests we need to call them…but we don’t want to each time.

I realize this is very open questions, but I wondered what support auth0 for unit testing? What is the best way of doing this? Is there a testing endpoint or is the best way to have this test as a manual run only?

Hi @meaganh

Welcome to the Auth0 Community.

We have some pointers here as to how you may mock the Auth0 API’s during testing.

We also have a blog here, it is a different stack but you can get an idea as to how it might work and perhaps do something similar in Java.

I hope this helps.

Warm regards.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.