    @Test
    public void testContextElementConversion() throws Exception {

        ContextElement ce = new ContextElement();
        ce.setEntityId(new EntityId("S1", "TempSensor", false));

        List<ContextAttribute> attributes = new LinkedList<>();
        attributes.add(new ContextAttribute("1", "string", "hello"));
        attributes.add(new ContextAttribute("1_string", null, "hello"));
        attributes.add(new ContextAttribute("2", "float", 1.4f));
        attributes.add(new ContextAttribute("3", "double", 3.1d));
        attributes.add(new ContextAttribute("4", "int", 3));
        attributes.add(new ContextAttribute("5", "long", 3l));
        attributes.add(new ContextAttribute("6", "boolean", true));
        attributes.add(new ContextAttribute("7", "boolean", false));
        attributes.add(new ContextAttribute("8", "date", "2015-12-01T17:12:28Z"));
        attributes.add(new ContextAttribute("9", "geo:point", "39.23, -10.3"));
        ce.setContextAttributeList(attributes);

        Map<String, Object> values = eventMapper.eventFromContextElement(ce).getValues();
        assertEquals("S1", values.get("id"));
        assertEquals("hello", values.get("1"));
        assertEquals("hello", values.get("1_string"));
        assertEquals(1.4f, values.get("2"));
        assertEquals(3.1d, values.get("3"));
        assertEquals(3, values.get("4"));
        assertEquals(3l, values.get("5"));
        assertEquals(true, values.get("6"));
        assertEquals(false, values.get("7"));
        assertEquals(new Date(1448989948000l), values.get("8"));
        assertEquals(Geospatial.readGeometry("POINT(39.23 -10.3)"), values.get("9"));
    }