MCPcopy Create free account
hub / github.com/apache/tomcat / testGetValue03

Method testGetValue03

test/jakarta/el/TestMapELResolver.java:79–95  ·  view source on GitHub ↗

Tests that a valid property is resolved.

()

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 4

getExpressionFactoryMethod · 0.95
getValueMethod · 0.95
putMethod · 0.65
isPropertyResolvedMethod · 0.45

Tested by

no test coverage detected