How to unit test Okta Java SDK

I’m trying to unit test my use of the Okta Java SDK to (1) retrieve User and Group information and (2) map the Okta Java SDK classes/instances to our own User and Group classes.

However, I’m having a hard time figuring out the best way to create dummy/mock test instances of Client, User, Group, List, and List for my unit tests.

I’d love to be able to just instantiate test Users and Groups, set their properties, and then use them in my unit tests. But I’m running into difficulties pulling this off.

Specifically, if I want to create a mock User (and a mock list of Users) for a test, how do I give UserBuilder the Client that it needs to .buildAndCreate(client)? Do I give it a real Client that’s configured with the information for, say, my Okta Developer account? Or can I just give it a mock Client? I’d like to avoid making actual HTTP requests to Okta APIs in my unit tests, if possible.

I’ve read @bdemers answer to a similar question from @hernan_plascencia here: Spring Boot Okta sdk user creation unit test But, being a relatively new developer, I could still use a bit more help with this.

NOTE: “List, and List” is supposed to read List<User>, and List<Group>. In my production code, I’m taking Okta Java SDK’s UserList and GroupList and converting them into Lists.

This seems to relate to this “closed” GitHub issue here: Writing Unit testing for sdk functions · Issue #617 · okta/okta-sdk-java · GitHub

As far as I can tell, no substantive answer/solution has been provided. Am I mistaken?