Code example for SimpleTypeConverter

0
 
        expect(ctx.getField()).andReturn(field).anyTimes(); 
        expect(ctx.getMessageContext()).andReturn(mctx).anyTimes(); 
        expect(field.getGroup()).andReturn(group).anyTimes(); 
        expect(group.getForm()).andReturn(form).anyTimes(); 
        expect(form.getTypeConverter()).andReturn(new SimpleTypeConverter()).anyTimes(); 
 
        replay(ctx, field, group, form); 
    } 
 
    @Test 
    public void init_expression() throws Exception { 
        // empty expression 
        JexlCondition cond = new JexlCondition(null); 
 
        try { 
            cond.afterPropertiesSet(); 
            fail(); 
        } catch (IllegalArgumentException e) { 
            assertThat(e, exception("missing condition expression"));