File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
spring-context/src/test/java/org/springframework/context/expression Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -67,6 +67,17 @@ public void mapAccessorCompilable() {
67
67
assertThat (ex .getValue (sec ,mapGetter )).isEqualTo ("bar" );
68
68
assertThat (SpelCompiler .compile (ex )).isTrue ();
69
69
assertThat (ex .getValue (sec ,mapGetter )).isEqualTo ("bar" );
70
+
71
+ // basic isWritable
72
+ ex = sep .parseExpression ("foo" );
73
+ assertThat (ex .isWritable (sec ,testMap )).isTrue ();
74
+
75
+ // basic write
76
+ ex = sep .parseExpression ("foo2" );
77
+ ex .setValue (sec , testMap , "bar2" );
78
+ assertThat (ex .getValue (sec ,testMap )).isEqualTo ("bar2" );
79
+ assertThat (SpelCompiler .compile (ex )).isTrue ();
80
+ assertThat (ex .getValue (sec ,testMap )).isEqualTo ("bar2" );
70
81
}
71
82
72
83
public static class MapGetter {
You can’t perform that action at this time.
0 commit comments