@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")); }
@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; }
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; } }
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; }  }
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; }   }
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; }    }