final MockPortletDefinitionId portletDefinitionId = new MockPortletDefinitionId(1);
final PortletApplicationDefinition portletApplicationDefinition = mock(PortletApplicationDefinition.class);
final PortletDefinition portletDefinition = mock(PortletDefinition.class);
final EventDefinitionReference searchRequestEventDefinitionReference = mock(EventDefinitionReference.class);
final EventDefinitionReference searchResultsEventDefinitionReference = mock(EventDefinitionReference.class);
final EventDefinition searchRequestEventDefinition = mock(EventDefinition.class);
final EventDefinition searchResultsEventDefinition = mock(EventDefinition.class);
when(event.getQName()).thenReturn(searchRequestName);
when(searchRequestEventDefinitionReference.getQualifiedName(anyString())).thenReturn(searchRequestName);
when(searchRequestEventDefinitionReference.getQName()).thenReturn(searchRequestName);
when(searchResultsEventDefinitionReference.getQualifiedName(anyString())).thenReturn(searchResultsName);
when(searchResultsEventDefinitionReference.getQName()).thenReturn(searchResultsName);
when(searchRequestEventDefinition.getQName()).thenReturn(searchRequestName);
when(searchRequestEventDefinition.getQualifiedName(anyString())).thenReturn(searchRequestName);
when(searchResultsEventDefinition.getQName()).thenReturn(searchResultsName);
when(searchResultsEventDefinition.getQualifiedName(anyString())).thenReturn(searchResultsName);
when(this.portletDefinitionRegistry.getParentPortletApplicationDescriptor(portletDefinitionId)).thenReturn(portletApplicationDefinition);
when(this.portletDefinitionRegistry.getParentPortletDescriptor(portletDefinitionId)).thenReturn(portletDefinition);