@Test public void emptyContext() throws Exception { RenderingContext ctx = RenderingContext.CtxBuilder.get(); try (Closeable wrapped = ctx.wrap().open()) { assertNull(ctx.getParameter(PARAM)); } }
@Test public void subContext() throws Exception { RenderingContext ctx = RenderingContext.CtxBuilder.get(); try (Closeable wrapped = ctx.wrap().with(PARAM, VALUE1).open()) { Object value = ctx.getParameter(PARAM); assertNotNull(value); assertEquals(VALUE1, value); try (Closeable wrapped2 = ctx.wrap().with(PARAM, VALUE2).open()) { value = ctx.getParameter(PARAM); assertNotNull(value); assertEquals(VALUE2, value); } value = ctx.getParameter(PARAM); assertNotNull(value); assertEquals(VALUE1, value); } }
@Test public void noContext() throws Exception { RenderingContext ctx = RenderingContext.CtxBuilder.get(); assertNull(ctx.getParameter(PARAM)); }