public function setUp()
{
$this->dispatchComponent = new DispatchComponent();
$this->mockComponentContext = $this->getMockBuilder(ComponentContext::class)->disableOriginalConstructor()->getMock();
$this->mockHttpRequest = $this->getMockBuilder(Request::class)->disableOriginalConstructor()->getMock();
$this->mockComponentContext->expects($this->any())->method('getHttpRequest')->will($this->returnValue($this->mockHttpRequest));
$this->mockHttpResponse = $this->getMockBuilder(Response::class)->disableOriginalConstructor()->getMock();
$this->mockComponentContext->expects($this->any())->method('getHttpResponse')->will($this->returnValue($this->mockHttpResponse));
$this->mockDispatcher = $this->getMockBuilder(Dispatcher::class)->getMock();
$this->inject($this->dispatchComponent, 'dispatcher', $this->mockDispatcher);
$this->mockActionRequest = $this->getMockBuilder(ActionRequest::class)->disableOriginalConstructor()->getMock();
$mockMediaTypeConverter = $this->createMock(MediaTypeConverterInterface::class);
$this->mockObjectManager = $this->createMock(ObjectManagerInterface::class);
$this->mockObjectManager->expects($this->any())->method('get')->willReturnMap([[ActionRequest::class, $this->mockHttpRequest, $this->mockActionRequest], [MediaTypeConverterInterface::class, $mockMediaTypeConverter]]);
$this->inject($this->dispatchComponent, 'objectManager', $this->mockObjectManager);
$this->mockSecurityContext = $this->getMockBuilder(Security\Context::class)->getMock();
$this->inject($this->dispatchComponent, 'securityContext', $this->mockSecurityContext);
$this->mockPropertyMapper = $this->getMockBuilder(PropertyMapper::class)->disableOriginalConstructor()->getMock();
$this->inject($this->dispatchComponent, 'propertyMapper', $this->mockPropertyMapper);
}