Tests that if the MapELResolver is constructed with readOnly the method will return always true, otherwise false.
()
| 183 | * Tests that if the MapELResolver is constructed with readOnly the method will return always true, otherwise false. |
| 184 | */ |
| 185 | @Test |
| 186 | public void testIsReadOnly03() { |
| 187 | MapELResolver mapELResolver = new MapELResolver(); |
| 188 | ELContext context = new StandardELContext(ELManager.getExpressionFactory()); |
| 189 | |
| 190 | boolean result = mapELResolver.isReadOnly(context, new HashMap<>(), new Object()); |
| 191 | |
| 192 | Assert.assertFalse(result); |
| 193 | Assert.assertTrue(context.isPropertyResolved()); |
| 194 | |
| 195 | mapELResolver = new MapELResolver(true); |
| 196 | |
| 197 | result = mapELResolver.isReadOnly(context, new HashMap<>(), new Object()); |
| 198 | |
| 199 | Assert.assertTrue(result); |
| 200 | Assert.assertTrue(context.isPropertyResolved()); |
| 201 | } |
| 202 | |
| 203 | /** |
| 204 | * Tests that the readOnly is true always when the map is not modifiable. |
nothing calls this directly
no test coverage detected