File tree 2 files changed +29
-1
lines changed
main/java/io/vertx/ext/auth/authorization/impl
test/java/io/vertx/tests/authorization/impl 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) {
34
34
int openingCurlyBracePos = value .indexOf ("{" , currentPos );
35
35
if (openingCurlyBracePos == -1 ) {
36
36
if (currentPos < value .length ()) {
37
- String authorizationPart = value .substring (currentPos , value . length () - currentPos );
37
+ String authorizationPart = value .substring (currentPos );
38
38
tmpParts .add (ctx -> authorizationPart );
39
39
}
40
40
break ;
Original file line number Diff line number Diff line change @@ -21,4 +21,32 @@ public void test1() {
21
21
String resolved = expression .resolve (MultiMap .caseInsensitiveMultiMap ().add ("foo" , "bar" ));
22
22
assertEquals ("bar" , resolved );
23
23
}
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
+ }
24
52
}
You can’t perform that action at this time.
0 commit comments