@@ -35,7 +35,7 @@ public void testIndexNullable() {
35
35
36
36
@ Test
37
37
public void testControllerNullable () {
38
- assertEquals ( null , new Route ("foo" , new HashSet <>(), new HashMap <String , String >() {{
38
+ assertNull ( new Route ("foo" , new HashSet <>(), new HashMap <String , String >() {{
39
39
put ("_controller" , null );
40
40
}}, new HashMap <>(), new ArrayList <>()).getController ());
41
41
@@ -47,10 +47,24 @@ public void testControllerNullable() {
47
47
@ Test
48
48
public void testPathVariables () {
49
49
StubIndexedRoute route = new StubIndexedRoute ("foobar" );
50
- route .setPath ("/foo/{foo}/{foobar}/bar" );
50
+ route .setPath ("/foo/{foo}/{foobar}/{#foo1}/{|foo2}/ bar" );
51
51
52
- assertTrue ("foobar" ,
53
- new Route (route ).getVariables ().containsAll (Arrays .asList ("foo" , "foobar" ))
52
+ Set <String > variables = new Route (route ).getVariables ();
53
+ assertEquals (2 , variables .size ());
54
+ assertTrue ("foobar" , variables .containsAll (Arrays .asList ("foo" , "foobar" )));
55
+ }
56
+
57
+ @ Test
58
+ public void testPathVariablesForDefault () {
59
+ StubIndexedRoute route = new StubIndexedRoute ("foobar" );
60
+ route .setPath ("/foo/{!foo}/{!foobar}//{Foobar2}bar" );
61
+
62
+ Set <String > variables = new Route (route ).getVariables ();
63
+
64
+ assertEquals (3 , variables .size ());
65
+ assertTrue (
66
+ "foobar" ,
67
+ variables .containsAll (Arrays .asList ("foo" , "foobar" , "Foobar2" ))
54
68
);
55
69
}
56
70
}
0 commit comments