@Test
	public void testCounterListing() throws Exception {
		Counter[] counters = new Counter[10];
		for (int i = 0; i < counters.length; i++) {
			counters[i] = new Counter("c" + i, i);
		}
		when(counterRepository.findAll()).thenReturn(Arrays.asList(counters));

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

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