@Test
public void testAggregateSourceMetrics() {

    final SourceMetrics sourceMetrics = COUNTER_REGISTRY.aggregateSourceMetrics(CONNECTION_ID);
    final Measurement[] expected = {
            getMeasurement(MAPPED, true),
            getMeasurement(MAPPED, false),
            getMeasurement(CONSUMED, true),
            getMeasurement(CONSUMED, false)
    };
    assertThat(sourceMetrics.getAddressMetrics().get(SOURCE).getMeasurements()).containsExactlyInAnyOrder(expected);
}