@Test
public void testGetTrafficSourcesWithCountrySearchKeywords()
	throws Exception {

	AnalyticsReportsDataProvider analyticsReportsDataProvider =
		new AnalyticsReportsDataProvider(
			_getHttp(
				Collections.singletonMap(
					"/traffic-sources",
					JSONUtil.putAll(
						JSONUtil.put(
							"countryKeywords",
							JSONUtil.putAll(
								JSONUtil.put(
									"countryCode", "us"
								).put(
									"countryName", "United States"
								).put(
									"keywords",
									JSONUtil.putAll(
										JSONUtil.put(
											"keyword", "liferay"
										).put(
											"position", 1
										).put(
											"searchVolume", 3600
										).put(
											"traffic", 2880L
										),
										JSONUtil.put(
											"keyword", "liferay portal"
										).put(
											"position", 1
										).put(
											"searchVolume", 390
										).put(
											"traffic", 312L
										))
								))
						).put(
							"name", "organic"
						).put(
							"trafficAmount", 3192L
						).put(
							"trafficShare", 93.93D
						),
						JSONUtil.put(
							"countryKeywords",
							JSONUtil.putAll(
								JSONUtil.put(
									"countryCode", "us"
								).put(
									"countryName", "United States"
								).put(
									"keywords",
									JSONUtil.putAll(
										JSONUtil.put(
											"keyword", "dxp enterprises"
										).put(
											"position", 1
										).put(
											"searchVolume", 4400
										).put(
											"traffic", 206L
										))
								))
						).put(
							"name", "paid"
						).put(
							"trafficAmount", 206L
						).put(
							"trafficShare", 6.07D
						)
					).toString())));
	List<TrafficSource> trafficSources =
		analyticsReportsDataProvider.getTrafficSources(
			RandomTestUtil.randomLong(), RandomTestUtil.randomString());
	Assert.assertEquals(
		trafficSources.toString(), 2, trafficSources.size());
	Assert.assertEquals(
		new TrafficSource(
			Collections.singletonList(
				new CountrySearchKeywords(
					"us",
					Arrays.asList(
						new SearchKeyword("liferay", 1, 3600, 2880L),
						new SearchKeyword(
							"liferay portal", 1, 390, 312L)))),
			"organic", 3192L, 93.93D),
		trafficSources.get(0));
	Assert.assertEquals(
		new TrafficSource(
			Collections.singletonList(
				new CountrySearchKeywords(
					"us",
					Collections.singletonList(
						new SearchKeyword(
							"dxp enterprises", 1, 4400, 206L)))),
			"paid", 206L, 6.07D),
		trafficSources.get(1));
}