PingPong.Service.Mock (PingPong v0.1.0)

Copy Markdown View Source

Local test service used for examples and development checks.

The mock service returns {:ok, "Pong! 🏓"} only for %{message: "Ping!"}. All other payloads return a deterministic mock error.

Summary

Functions

Handles a mock notification.

Functions

call(arg1, _)

@spec call(map(), map()) :: {:ok, binary()} | {:error, {atom(), any()}}

Handles a mock notification.

Examples

iex> PingPong.Service.Mock.call(%{message: "Ping!"}, %{})
{:ok, "Pong! 🏓"}

iex> PingPong.Service.Mock.call(%{}, %{})
{:error, {:mock_error, false}}