Route { public Route bind(String varName, String regex) { requirements.put(varName, sanitizeRequirement(varName, regex)); return this; } Route(String path, Class<? extends Activity> activityClass, String[] schemes);  Route(String path, Class<? extends Activity> activityClass);  Route(
            String path,
            Class<? extends Activity> proxyActivityClass,
            String destIdentify
    );  Route(
            String path,
            Class<? extends Activity> proxyActivityClass,
            String proxyDestIdentify,
            Class<? extends RouterProxy>... middlewares); List<String> getSchemes(); Route setSchemes(List<String> schemes); String getAnchor(); void setActivityClass(Class<? extends Activity> activityClass); Class<? extends Activity> getActivityClass(); HashMap<String, String> getRequirements(); String getPath(); Route bind(String varName, String regex); Route bindWeight(int weight); Map<String, String> getQueries(); Route anchor(String anchor); static Route route(String path, Class<? extends Activity> activityClass); void addTo(Router router); void addTo(); List<Class<? extends RouterProxy>> getMiddlewares(); void setMiddlewares(List<Class<? extends RouterProxy>> middlewares); String getProxyDestIdentify(); void setProxyDestIdentify(String proxyDestIdentify); String toString(); static final int TYPE_DIRECTLY; static final int TYPE_PROXY; static final String SCHEME_HTTP; static final String SCHEME_HTTPS; static final String SCHEME_TEL; static final String SCHEME_MAILTO; static final String SCHEME_ANY; }
@Test(expected = IllegalArgumentException.class) public void testBind() { HashMap<String, String> expectedMap = new HashMap<>(); expectedMap.put("vendor", "\\w+"); assertEquals( expectedMap, new Route("github.com/{vendor}", Activity.class).bind("vendor", "^\\w+$").getRequirements() ); assertEquals( expectedMap, new Route("github.com/{vendor}", Activity.class).bind("vendor", "^\\w+").getRequirements() ); assertEquals( expectedMap, new Route("github.com/{vendor}", Activity.class).bind("vendor", "\\w+$").getRequirements() ); new Route("github.com/{vendor}", Activity.class).bind("vendor", ""); }