@Test
public void shouldHandleMBeanAttributeNotANumberOrString() throws Exception {

    // given
    GaugeConfig gaugeConfig = ImmutableGaugeConfig.builder()
            .mbeanObjectName("xyz:aaa=bbb")
            .addMbeanAttributes(ImmutableMBeanAttribute.of("ccc", false))
            .addMbeanAttributes(ImmutableMBeanAttribute.of("ddd", false))
            .build();
    when(lazyPlatformMBeanServer.getAttribute(any(ObjectName.class), anyString(),
            anyMBeanServerList())).thenReturn(new Object());
    // when
    collectGaugeValues(gaugeConfig);
    collectGaugeValues(gaugeConfig);
    collectGaugeValues(gaugeConfig);
    collectGaugeValues(gaugeConfig);
    collectGaugeValues(gaugeConfig);
    // then
    verify(logger).warn("error accessing mbean attribute {} {}: {}", "xyz:aaa=bbb", "ccc",
            "MBean attribute value is not a number or string");
    verify(logger).warn("error accessing mbean attribute {} {}: {}", "xyz:aaa=bbb", "ddd",
            "MBean attribute value is not a number or string");
}