@Test
public void intersectCountriesOnEquatorWithLayerFilter() throws Exception {

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