@Test
public void testConvertWeaselBeaconToSpan_withXHRBeacon() throws ServletException, IOException {

	// Given
	MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest();
	mockHttpServletRequest.setParameter("r", "1496994284184");
	mockHttpServletRequest.setParameter("k", "null");
	mockHttpServletRequest.setParameter("ts", "21793");
	mockHttpServletRequest.setParameter("d", "2084");
	mockHttpServletRequest.setParameter("ty", "xhr");
	mockHttpServletRequest.setParameter("pl", "d58cddae830273d1");
	mockHttpServletRequest.setParameter("l", "http://localhost:9966/petclinic/");
	mockHttpServletRequest.setParameter("m", "GET");
	mockHttpServletRequest.setParameter("u", "http://localhost:9966/petclinic/owners.html?lastName=");
	mockHttpServletRequest.setParameter("a", "1");
	mockHttpServletRequest.setParameter("st", "200");
	mockHttpServletRequest.setParameter("e", "undefined");
	mockHttpServletRequest.setParameter("m_user", "tom.mason@example.com");
	mockHttpServletRequest.setParameter("t", "2d371455215c504");
	mockHttpServletRequest.setParameter("s", "2d371455215c504");
	// When
	servlet.doGet(mockHttpServletRequest, new MockHttpServletResponse());
	// Then
	assertSoftly(softly -> {
		final List<MockSpan> finishedSpans = mockTracer.finishedSpans();
		softly.assertThat(finishedSpans).hasSize(1);
		MockSpan span = finishedSpans.get(0);
		softly.assertThat(span.operationName()).isEqualTo("/petclinic/owners.html");
		softly.assertThat(span.finishMicros() - span.startMicros()).isEqualTo(TimeUnit.MILLISECONDS.toMicros(2084L));
		softly.assertThat(span.tags())
				.doesNotContainEntry(Tags.SAMPLING_PRIORITY.getKey(), 0)
				.containsEntry("type", "ajax")
				.containsEntry("http.status_code", 200L)
				.containsEntry("method", "GET")
				.containsEntry("xhr.requested_url", "http://localhost:9966/petclinic/owners.html?lastName=")
				.containsEntry("xhr.requested_from", "http://localhost:9966/petclinic/")
				.containsEntry("xhr.async", true)
				.containsEntry("duration_ms", 2084L)
				.containsEntry("id", "2d371455215c504")
				.containsEntry("trace_id", "2d371455215c504");
	});
}