ExpansionHandler implements RuleChangesObserver { public boolean isCollection(String target) { return target.endsWith("/"); } ExpansionHandler(Vertx vertx, final ResourceStorage storage, HttpClient httpClient, final Map<String, Object> properties, String serverRoot, final String rulesPath); @Override void rulesChanged(List<Rule> rules); int getMaxExpansionLevelSoft(); int getMaxExpansionLevelHard(); int getMaxSubRequestCount(); boolean isExpansionRequest(HttpServerRequest request); boolean isZipRequest(HttpServerRequest request); void handleExpansionRecursion(final HttpServerRequest request); void handleZipRecursion(final HttpServerRequest request); boolean isCollection(String target); static final String SERIOUS_EXCEPTION; static final String EXPAND_PARAM; static final String ZIP_PARAM; static final String MAX_EXPANSION_LEVEL_SOFT_PROPERTY; static final String MAX_EXPANSION_LEVEL_HARD_PROPERTY; static final String MAX_SUBREQUEST_PROPERTY; }
@Test public void testIsCollection(TestContext context) { expansionHandler = new ExpansionHandler(vertx, storage, httpClient, new HashMap<>(), ROOT, RULES_ROOT); context.assertFalse(expansionHandler.isCollection("/some/collection/uri")); context.assertTrue(expansionHandler.isCollection("/some/collection/")); }