# Okta Java SDK and test isolation

**URL:** <https://devforum.okta.com/t/okta-java-sdk-and-test-isolation/19657>\
**Category:** Questions\
**Created:** [March 3, 2022, 2:25pm UTC](https://devforum.okta.com/t/okta-java-sdk-and-test-isolation/19657 "2022-03-03T14:25:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![P1ll3P4ll3](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@P1ll3P4ll3](https://devforum.okta.com/u/P1ll3P4ll3)\
**Post date:** [March 3, 2022, 2:25pm UTC](https://devforum.okta.com/t/okta-java-sdk-and-test-isolation/19657/1 "2022-03-03T14:25:33Z")

</div>

We are using the Okta Java SDK. Is there any guidance out there on how to get the different objects isolated in Unit Tests?

To be able to test the different methods of our service implementations (Spring) we would have to create or mock a client object and must be able to, e.g. create a user object or a list of UserList. The User Builder needs a client object. So it is not possible to directly create a user object.

Would it be possible to get some guidance?

Thanks!

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 12, 2024, 6:13pm UTC](https://devforum.okta.com/t/okta-java-sdk-and-test-isolation/19657/2 "2024-02-12T18:13:50Z")

</div>


