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

Method testSetValue05

test/jakarta/el/TestMapELResolver.java:143–150  ·  view source on GitHub ↗

Tests that an exception is thrown when the map is not modifiable.

()

Source from the content-addressed store, hash-verified

141 * Tests that an exception is thrown when the map is not modifiable.
142 */
143 @Test(expected = PropertyNotWritableException.class)
144 public void testSetValue05() {
145 MapELResolver mapELResolver = new MapELResolver();
146 ELContext context = new StandardELContext(ELManager.getExpressionFactory());
147
148 Map<Object,Object> map = Collections.unmodifiableMap(new HashMap<>());
149 mapELResolver.setValue(context, map, "key", "value");
150 }
151
152 /**
153 * Tests that a null context results in an NPE as per EL Javadoc.

Callers

nothing calls this directly

Calls 2

getExpressionFactoryMethod · 0.95
setValueMethod · 0.95

Tested by

no test coverage detected