File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
main/java/io/vertx/ext/auth/authorization/impl
test/java/io/vertx/tests/authorization/impl Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public VariableAwareExpression(String value) {
3434 int openingCurlyBracePos = value .indexOf ("{" , currentPos );
3535 if (openingCurlyBracePos == -1 ) {
3636 if (currentPos < value .length ()) {
37- String authorizationPart = value .substring (currentPos , value . length () - currentPos );
37+ String authorizationPart = value .substring (currentPos );
3838 tmpParts .add (ctx -> authorizationPart );
3939 }
4040 break ;
Original file line number Diff line number Diff line change @@ -21,4 +21,32 @@ public void test1() {
2121 String resolved = expression .resolve (MultiMap .caseInsensitiveMultiMap ().add ("foo" , "bar" ));
2222 assertEquals ("bar" , resolved );
2323 }
24+
25+ @ Test
26+ public void test2 () {
27+ VariableAwareExpression expression = new VariableAwareExpression ("{bar}end" );
28+ String resolved = expression .resolve (MultiMap .caseInsensitiveMultiMap ().add ("bar" , "foo" ));
29+ assertEquals ("fooend" , resolved );
30+ }
31+
32+ @ Test
33+ public void test3 () {
34+ VariableAwareExpression expression = new VariableAwareExpression ("begin{bar}" );
35+ String resolved = expression .resolve (MultiMap .caseInsensitiveMultiMap ().add ("bar" , "foo" ));
36+ assertEquals ("beginfoo" , resolved );
37+ }
38+
39+ @ Test
40+ public void test4 () {
41+ VariableAwareExpression expression = new VariableAwareExpression ("part1,part2{bar}" );
42+ String resolved = expression .resolve (MultiMap .caseInsensitiveMultiMap ().add ("bar" , "foo" ));
43+ assertEquals ("part1,part2foo" , resolved );
44+ }
45+
46+ @ Test
47+ public void test5 () {
48+ VariableAwareExpression expression = new VariableAwareExpression ("part1{bar}part2,part3" );
49+ String resolved = expression .resolve (MultiMap .caseInsensitiveMultiMap ().add ("bar" , "foo" ));
50+ assertEquals ("part1foopart2,part3" , resolved );
51+ }
2452}
You can’t perform that action at this time.
0 commit comments