### Question:
ZuulFiltersModule extends AbstractModule { @VisibleForTesting String[] findFilterLocations(AbstractConfiguration config) { String[] locations = config.getStringArray("zuul.filters.locations"); if (locations == null) { locations = new String[]{"inbound", "outbound", "endpoint"}; } String[] filterLocations = Arrays.stream(locations) .map(String::trim) .filter(blank.negate()) .toArray(String[]::new); if (filterLocations.length != 0) { LOG.info("Using filter locations: "); for (String location : filterLocations) { LOG.info(" " + location); } } return filterLocations; }    }### Answer:
@Test public void testDefaultFilterLocations() { when(configuration.getStringArray(eq("zuul.filters.locations"))).thenReturn("inbound,outbound,endpoint".split(",")); String[] filterLocations = module.findFilterLocations(configuration); assertThat(filterLocations.length, equalTo(3)); assertThat(filterLocations[1], equalTo("outbound")); }
@Test public void testEmptyFilterLocations() { when(configuration.getStringArray(eq("zuul.filters.locations"))).thenReturn(new String[0]); String[] filterLocations = module.findFilterLocations(configuration); assertThat(filterLocations.length, equalTo(0)); }
@Test public void testDefaultFilterLocations() { Mockito.when(configuration.getStringArray("zuul.filters.locations")) .thenReturn("inbound,outbound,endpoint".split(",")); String[] filterLocations = module.findFilterLocations(configuration); assertThat(filterLocations.length, equalTo(3)); assertThat(filterLocations[1], equalTo("outbound")); }
@Test public void testEmptyFilterLocations() { Mockito.when(configuration.getStringArray("zuul.filters.locations")).thenReturn(new String[0]); String[] filterLocations = module.findFilterLocations(configuration); assertThat(filterLocations.length, equalTo(0)); }