diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/index.test.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/index.test.tsx
index 2f05842b6bdec..e7ce4bb24b38f 100644
--- a/x-pack/plugins/apm/public/components/app/ServiceMap/index.test.tsx
+++ b/x-pack/plugins/apm/public/components/app/ServiceMap/index.test.tsx
@@ -5,6 +5,7 @@
*/
import { render } from '@testing-library/react';
+import { createMemoryHistory } from 'history';
import { CoreStart } from 'kibana/public';
import React, { ReactNode } from 'react';
import { createKibanaReactContext } from 'src/plugins/kibana_react/public';
@@ -15,6 +16,10 @@ import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_ap
import { LicenseContext } from '../../../context/license/license_context';
import * as useFetcherModule from '../../../hooks/use_fetcher';
import { ServiceMap } from './';
+import { UrlParamsProvider } from '../../../context/url_params_context/url_params_context';
+import { Router } from 'react-router-dom';
+
+const history = createMemoryHistory();
const KibanaReactContext = createKibanaReactContext({
usageCollection: { reportUiCounter: () => {} },
@@ -49,7 +54,9 @@ function createWrapper(license: License | null) {