@Test
	public void testRichGaugesListing() throws Exception {
		RichGauge[] counters = new RichGauge[10];
		for (int i = 0; i < counters.length; i++) {
			counters[i] = new RichGauge("c" + i, 15, 0.5, 16, 20, 10, 100);
		}
		when(richGaugeRepository.findAll()).thenReturn(Arrays.asList(counters));

		ResultActions resActions = mockMvc.perform(get("/metrics/rich-gauges")).andExpect(status().isOk())//
		.andExpect(jsonPath("$.content", Matchers.hasSize(10)));

		for (int i = 0; i < 10; i++) {
			resActions.andExpect(jsonPath("$.content[" + i + "].name").value("c" + i));
			resActions.andExpect(jsonPath("$.content[" + i + "].value").doesNotExist());
			resActions.andExpect(jsonPath("$.content[" + i + "].alpha").doesNotExist());
			resActions.andExpect(jsonPath("$.content[" + i + "].average").doesNotExist());
			resActions.andExpect(jsonPath("$.content[" + i + "].max").doesNotExist());
			resActions.andExpect(jsonPath("$.content[" + i + "].min").doesNotExist());
			resActions.andExpect(jsonPath("$.content[" + i + "].count").doesNotExist());
		}
	}
@author Luke Taylor
@author Ilayaperumal Gopinathan
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/rest/metrics/RichGaugeControllerIntegrationTests.java