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

	// Given
	final String userAgentHeader = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36";
	MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest();
	mockHttpServletRequest.addHeader("user-agent", userAgentHeader);
	mockHttpServletRequest.setParameter("ty", "pl");
	mockHttpServletRequest.setParameter("r", "1496751574200");
	mockHttpServletRequest.setParameter("u", "http://localhost:9966/petclinic/");
	mockHttpServletRequest.setParameter("m_user", "tom.mason@example.com");
	mockHttpServletRequest.setParameter("ts", "-197");
	mockHttpServletRequest.setParameter("d", "518");
	mockHttpServletRequest.setParameter("sp", "1");
	mockHttpServletRequest.setParameter("m_bsp", "1");
	mockHttpServletRequest.setParameter("t_unl", "0");
	mockHttpServletRequest.setParameter("t_red", "0");
	mockHttpServletRequest.setParameter("t_apc", "5");
	mockHttpServletRequest.setParameter("t_dns", "0");
	mockHttpServletRequest.setParameter("t_tcp", "0");
	mockHttpServletRequest.setParameter("t_ssl", "2");
	mockHttpServletRequest.setParameter("t_req", "38");
	mockHttpServletRequest.setParameter("t_rsp", "4");
	mockHttpServletRequest.setParameter("t_pro", "471");
	mockHttpServletRequest.setParameter("t_loa", "5");
	mockHttpServletRequest.setParameter("t_fp", "151");
	// TODO, ignore for now
	mockHttpServletRequest.setParameter("k", "someKey"); // not necessary
	mockHttpServletRequest.setParameter("t", "a6b5fd025be24191"); // trace id -> opentracing does not specify this yet
	mockHttpServletRequest.setParameter("res", "{\"http://localhost:9966/petclinic/\":{\"webjars/\":{\"bootstrap/2.3.0/\":{\"css/bootstrap.min.css\":[\"-136,10,2,1,105939\"],\"img/glyphicons-halflings.png\":[\"-48,0,4,1,12799\"]},\"jquery\":{\"/2.0.3/jquery.js\":[\"-136,0,3,1,242142\"],\"-ui/1.10.3/\":{\"ui/jquery.ui.\":{\"core.js\":[\"-136,0,3,1,8198\"],\"datepicker.js\":[\"-136,0,3,1,76324\"]},\"themes/base/jquery-ui.css\":[\"-136,8,2,1,32456\"]}}},\"resources/\":{\"css/petclinic.css\":[\"-136,8,2,1,243\"],\"images/\":{\"banner-graphic.png\":[\"-136,0,1,1,13773\"],\"pets.png\":[\"-136,0,1,1,55318\"],\"spring-pivotal-logo.png\":[\"-136,0,1,1,2818\"]}},\"stagemonitor/\":{\"public/static/\":{\"rum/boomerang-56c823668fc.min.js\":[\"-136,0,3,1,12165\"],\"eum.debug.js\":[\"-32,12,3,3,23798\"]},\"static/stagemonitor\":{\".png\":[\"-136,16,1,3,1694\"],\"-modal.html\":[\"-33,9,5,3,10538\"]}}}}");
	// When
	servlet.doPost(mockHttpServletRequest, new MockHttpServletResponse());
	// Then
	verify(reportingSpanEventListener, never()).update(any(), any(), any());
	assertSoftly(softly -> {
		final List<MockSpan> finishedSpans = mockTracer.finishedSpans();
		softly.assertThat(finishedSpans).hasSize(1);
		MockSpan span = finishedSpans.get(0);
		softly.assertThat(span.operationName()).isEqualTo("/petclinic/");
		softly.assertThat(span.finishMicros() - span.startMicros()).isEqualTo(TimeUnit.MILLISECONDS.toMicros(518L));
		final long redirect = 0L;
		final long appCacheLookup = 5L;
		final long dns = 0L;
		final long tcp = 0L;
		final long ssl = 2L;
		final long request = 38L;
		final long response = 4L;
		softly.assertThat(span.tags())
				.containsEntry("type", "pageload")
				.doesNotContainEntry(Tags.SAMPLING_PRIORITY.getKey(), 0)
				.doesNotContainKey("user")
				.containsEntry("user_agent.header", userAgentHeader)
				.containsEntry("http.url", "http://localhost:9966/petclinic/")
				.containsEntry("timing.unload", 0L)
				.containsEntry("timing.redirect", redirect)
				.containsEntry("timing.app_cache_lookup", appCacheLookup)
				.containsEntry("timing.dns_lookup", dns)
				.containsEntry("timing.tcp", tcp)
				.containsEntry("timing.ssl", ssl)
				.containsEntry("timing.request", request)
				.containsEntry("timing.response", response)
				.containsEntry("timing.processing", 471L)
				.containsEntry("timing.load", 5L)
				.containsEntry("timing.time_to_first_paint", 151L)
				.containsEntry("timing.resource", redirect + appCacheLookup + dns + tcp + ssl + request + response);
	});
}