@Test
	public void testhandlerWithExpression() {

		@SuppressWarnings("resource")
		AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();

		MapPropertySource propertiesSource = new MapPropertySource("test", Collections.singletonMap("valueExpression",
				(Object) "payload.get('price').asDouble()"));

		applicationContext.getEnvironment().getPropertySources().addLast(propertiesSource);

		applicationContext.register(RichGaugeHandlerTestsConfig.class);

		applicationContext.refresh();
		input = applicationContext.getBean("input", MessageChannel.class);
		repo = applicationContext.getBean(RedisRichGaugeRepository.class);

		String json = "{\"symbol\":\"VMW\", \"price\":73}";
		StringToJsonNodeTransformer txf = new StringToJsonNodeTransformer();
		JsonNode node = txf.transform(json);
		assertEquals(73.0, node.get("price").asDouble(), 0.001);

		input.send(new GenericMessage<Object>(node));

		RichGauge gauge = repo.findOne("test");
		assertNotNull(gauge);
		assertEquals(73.0, gauge.getValue(), 0.001);
		// assertEquals(1, gauge.getCount());

		// Included here because the message handler constructor creates the gauge. Don't want to
		// delete it in @After.
		repo.delete("test");
	}
@author David Turanski
@author Gary Russell
spring-xd-analytics/src/test/java/org/springframework/xd/analytics/metrics/integration/RichGaugeHandlerTests.java