//add default content
contentAPI.setContent("content for default", "testtag_default",
true, helper.loginAsPortalAdmin());
//city content if available
GeoLocationAPI geoLocationAPI = new GeoLocationAPI();
APIResponse response = geoLocationAPI.
getMostRelevantContent("testtag", "melbourne",
"vic", "australia");
String content = (String) response.object;
assertTrue(content.equals("content for melbourne"));
assertTrue(response.userFriendlyMessage.contains("testtag_melbourne"));
//region content if city content is not available
response = geoLocationAPI.
getMostRelevantContent("testtag", "portland",
"vic", "australia");
content = (String) response.object;
assertTrue(content.equals("content for victoria"));
assertTrue(response.userFriendlyMessage.contains("testtag_vic"));
//country content if both city and region not available
response = geoLocationAPI.
getMostRelevantContent("testtag", "sydney",
"new south wales", "australia");
content = (String) response.object;
assertTrue(content.equals("content for australia"));
assertTrue(response.userFriendlyMessage.contains("testtag_australia"));
//default content if city, region and country contents not available
response = contentAPI.setPublishStatus("testtag_australia", false, helper.loginAsPortalAdmin());
assertTrue(response.statusCode == Status.SUCCESS);
response = geoLocationAPI.
getMostRelevantContent("testtag", "sydney",
"new south wales", "australia");
content = (String) response.object;
assertTrue(content.equals("content for default"));
assertTrue(response.userFriendlyMessage.contains("testtag_default"));