# Mock side effect?

**URL:** <https://community.temporal.io/t/mock-side-effect/9870>\
**Category:** Community Support\
**Tags:** go-sdk\
**Created:** [October 19, 2023, 7:11am UTC](https://community.temporal.io/t/mock-side-effect/9870 "2023-10-19T07:11:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Theodore\_Felix\_Leo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/theodore_felix_leo/32/3978_2.png) [@Theodore\_Felix\_Leo](https://community.temporal.io/u/Theodore_Felix_Leo)\
**Post date:** [October 19, 2023, 7:11am UTC](https://community.temporal.io/t/mock-side-effect/9870/1 "2023-10-19T07:11:01Z")

</div>

Hi i understand that we can mock Activity for unit testing. But what about side effect? E.g. we have side effect that returns a random number.

The only workaround we can think of right now is to monkey patch the function that generate the random number inside the side effect, but we want to avoid that if possible.

Thanks!

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [October 19, 2023, 10:12am UTC](https://community.temporal.io/t/mock-side-effect/9870/2 "2023-10-19T10:12:08Z")

</div>

Unfortunately not yet:

> <https://github.com/temporalio/sdk-go/issues/916>
>
> \*\*Is your feature request related to a problem? Please describe.\*\*
> 
> Can't inte…rcept side effect calls
> 
> \*\*Describe the solution you'd like\*\*
> 
> Add something like \`TestWorkflow.OnSideEffect\` and \`TestWorkflow.OnMutableSideEffect\`

---

<div class="post-metadata">

**Author:** ![Theodore\_Felix\_Leo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/theodore_felix_leo/32/3978_2.png) [@Theodore\_Felix\_Leo](https://community.temporal.io/u/Theodore_Felix_Leo)\
**Post date:** [October 20, 2023, 2:55am UTC](https://community.temporal.io/t/mock-side-effect/9870/3 "2023-10-20T02:55:36Z")

</div>

thanks Maxim
