def METHOD_NAME(self, mock_eventstream):
    group1 = self.create_group(self.project)
    group2 = self.create_group(self.project)
    eventstream_state = object()
    with self.tasks():
        merge_groups([group1.id], group2.id, eventstream_state=eventstream_state)
    mock_eventstream.end_merge.assert_called_once_with(eventstream_state)