@Test
public void testGetTrafficSources() throws Exception {

	AnalyticsReportsDataProvider analyticsReportsDataProvider =
		new AnalyticsReportsDataProvider(
			_getHttp(
				Collections.singletonMap(
					"/traffic-sources",
					JSONUtil.putAll(
						JSONUtil.put(
							"name", "organic"
						).put(
							"trafficAmount", 3849L
						).put(
							"trafficShare", 94.25D
						),
						JSONUtil.put(
							"name", "paid"
						).put(
							"trafficAmount", 235L
						).put(
							"trafficShare", 5.75D
						)
					).toString())));
	List<TrafficSource> trafficSources =
		analyticsReportsDataProvider.getTrafficSources(
			RandomTestUtil.randomLong(), RandomTestUtil.randomString());
	Assert.assertEquals(
		trafficSources.toString(), 2, trafficSources.size());
	Assert.assertEquals(
		new TrafficSource(null, "organic", 3849L, 94.25D),
		trafficSources.get(0));
	Assert.assertEquals(
		new TrafficSource(null, "paid", 235L, 5.75D),
		trafficSources.get(1));
}