@Test
	public void testCounterListing() throws Exception {
		FieldValueCounter[] counters = new FieldValueCounter[10];
		Map<String, Double> fieldValueCount = new HashMap<String, Double>();
		fieldValueCount.put("num", 15.0);
		for (int i = 0; i < counters.length; i++) {
			counters[i] = new FieldValueCounter("c" + i, fieldValueCount);
		}
		when(fieldValueCounterRepository.findAll()).thenReturn(Arrays.asList(counters));

		ResultActions resActions = mockMvc.perform(get("/metrics/field-value-counters")).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 + "].counts").doesNotExist());
		}
	}
Tests proper behavior of {@link FieldValueCountersController}.

@author Eric Bottard
@author Ilayaperumal Gopinathan
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/rest/metrics/FieldValueCountersControllerIntegrationTests.java