Mocking a module inside LocalCluster


I am trying to mock a module behavior inside my LocalCluster using :erpc and mox libraries. Is this the correct way to do it, as I still get error inside the node that the mock is not defined., Application, :put_env, [:service, :connector_api_module, ConnectorApiMock]), Mox, :stub, [ConnectorApiMock, :stop_in, fn _ -> :ok end])

Thank you

What mode is Mox in? In the default “private” mode, all that the code you posted will accomplish is stubbing ConnectorApiMock for the erpc handler process on the remote node…

I changed it to the global mode and it worked. Thank you