Tests that a valid property is resolved.
()
| 77 | * Tests that a valid property is resolved. |
| 78 | */ |
| 79 | @Test |
| 80 | public void testGetValue03() { |
| 81 | MapELResolver mapELResolver = new MapELResolver(); |
| 82 | ELContext context = new StandardELContext(ELManager.getExpressionFactory()); |
| 83 | |
| 84 | Map<String,String> map = new HashMap<>(); |
| 85 | map.put("key", "value"); |
| 86 | Object result = mapELResolver.getValue(context, map, "key"); |
| 87 | |
| 88 | Assert.assertEquals("value", result); |
| 89 | Assert.assertTrue(context.isPropertyResolved()); |
| 90 | |
| 91 | result = mapELResolver.getValue(context, map, "unknown-key"); |
| 92 | |
| 93 | Assert.assertNull(result); |
| 94 | Assert.assertTrue(context.isPropertyResolved()); |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Tests that a null context results in an NPE as per EL Javadoc. |
nothing calls this directly
no test coverage detected