# Mock GetWorkflowExecutionHistory

**URL:** <https://community.temporal.io/t/mock-getworkflowexecutionhistory/4341>\
**Category:** Community Support\
**Tags:** go-sdk\
**Created:** [April 1, 2022, 12:29am UTC](https://community.temporal.io/t/mock-getworkflowexecutionhistory/4341 "2022-04-01T00:29:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sayuru](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/sayuru/32/2537_2.png) [@Sayuru](https://community.temporal.io/u/Sayuru)\
**Post date:** [April 1, 2022, 12:29am UTC](https://community.temporal.io/t/mock-getworkflowexecutionhistory/4341/1 "2022-04-01T00:29:46Z")

</div>

Hey all,  
I’m trying to mock `GetWorkflowExecutionHistory` for a test. My workflow is triggered via `SignalWithStartWorkflow` and it makes calls to `SignalWithStartWorkflowExecution` and `GetWorkflowExecutionHistory`. In my tests, I’m expecting to mock the behaviour of a new workflow.

My current test code for mock returns the following

```auto
&temporalWfServ.GetWorkflowExecutionHistoryResponse{
				History: &history.History{
					Events: []*history.HistoryEvent{
						{
							EventId: 1,
							EventTime: &eventTime,
							EventType: enums.EventType(1), // EVENT_TYPE_WORKFLOW_EXECUTION_STARTED
							Version: 1,
							TaskId: 1,
							Attributes: nil,
						},
						{
							EventId: 2,
							EventTime: &eventTime,
							EventType: enums.EventType(26), // EVENT_TYPE_WORKFLOW_EXECUTION_SIGNALED
							Version: 1,
							TaskId: 2,
							Attributes: nil,
						},
					},
				},
				RawHistory: nil,
				NextPageToken: nil,
				Archived: false,
			}, nil

```

However, I’m getting the error: unexpected event type WorkflowExecutionStarted when handling workflow execution result

How do I get this done correctly?

---

<div class="post-metadata">

**Author:** ![Chad\_Retz](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chad_retz/32/1396_2.png) [@Chad\_Retz](https://community.temporal.io/u/Chad_Retz)\
**Post date:** [April 1, 2022, 11:48am UTC](https://community.temporal.io/t/mock-getworkflowexecutionhistory/4341/2 "2022-04-01T11:48:51Z")

</div>

> [@Sayuru](#):
>
> In my tests, I’m expecting to mock the behaviour of a new workflow.

Can you clarify this a bit?

Mocking a history response is rarely the best level to do this at. If you need to mock a workflow execution result, mock that call, not how the internal logic for that call uses history. That internal logic may change in any version. If you need to mock `SignalWithStartWorkflow`, mock it at that level, don’t mock internal things it might use because that internal logic may change.
