@Test
public void intersectCountriesOnEquatorWithLayerFilters() throws Exception {

	// prepare command
	SearchByLocationRequest request = new SearchByLocationRequest();
	request.setCrs("EPSG:4326");
	request.setQueryType(SearchByLocationRequest.QUERY_INTERSECTS);
	request.setSearchType(SearchByLocationRequest.SEARCH_ALL_LAYERS);
	
	final String region1ResultTag = "countries layer region 1";
	final String region2ResultTag = "countries layer region 2";
	
	request.addLayerWithFilter(region1ResultTag, LAYER_ID, "region='Region 1'");
	request.addLayerWithFilter(region2ResultTag, LAYER_ID, "region='Region 2'");
	
	GeometryFactory factory = new GeometryFactory();
	LineString equator = factory.createLineString(new Coordinate[] {new Coordinate(0, 0),
			new Coordinate(-180, 180)});
	request.setLocation(converter.toDto(equator));
	String requestToString = request.toString();
	Assert.assertTrue(requestToString.length() > 24);
	// execute
	SearchByLocationResponse response = (SearchByLocationResponse) dispatcher.execute(
			SearchByLocationRequest.COMMAND, request, null, "en");
	// test
	Assert.assertFalse(response.isError());
	List<Feature> features;
	List<String> actual;
	features = response.getFeatureMap().get(region1ResultTag);
	Assert.assertNotNull(features);
	Assert.assertEquals(2, features.size());
	actual = new ArrayList<String>();
	for (Feature feature : features) {
		actual.add(feature.getLabel());
	}
	Assert.assertTrue(actual.contains("Country 2"));
	Assert.assertTrue(actual.contains("Country 1"));
	features = response.getFeatureMap().get(region2ResultTag);
	Assert.assertNotNull(features);
	Assert.assertEquals(2, features.size());
	actual = new ArrayList<String>();
	for (Feature feature : features) {
		actual.add(feature.getLabel());
	}
	Assert.assertTrue(actual.contains("Country 4"));
}