@Test public void delegatesCreateIntCounterToTypeFactory() { StatisticDescriptor descriptorCreatedByFactory = mock(StatisticDescriptor.class); when(typeFactory.createIntCounter(any(), any(), any())) .thenReturn(descriptorCreatedByFactory); StatisticDescriptor result = registry.createIntCounter(DESCRIPTOR_NAME, DESCRIPTOR_DESCRIPTION, DESCRIPTOR_UNITS); assertThat(result) .isEqualTo(descriptorCreatedByFactory); }
@Test public void delegatesCreateLargerBetterIntCounterToTypeFactory() { StatisticDescriptor descriptorCreatedByFactory = mock(StatisticDescriptor.class); when(typeFactory.createIntCounter(any(), any(), any(), anyBoolean())) .thenReturn(descriptorCreatedByFactory); StatisticDescriptor result = registry.createIntCounter(DESCRIPTOR_NAME, DESCRIPTOR_DESCRIPTION, DESCRIPTOR_UNITS, true); assertThat(result) .isEqualTo(descriptorCreatedByFactory); }