@Test public void add() { long platformId = 7L; String attributeName = "attributeName"; String objectName = "objectname"; long attributeId = 13L; String attributeType = "type"; String attributeDecs = "desc"; boolean isIs = false; boolean readable = true; boolean writable = false; when(filter.matches(assignment, descriptor)).thenReturn(true); when(agentConfig.getPlatformId()).thenReturn(platformId); when(descriptor.getAttributeName()).thenReturn(attributeName); when(descriptor.getmBeanAttributeDescription()).thenReturn(attributeDecs); when(descriptor.getmBeanObjectName()).thenReturn(objectName); when(descriptor.getmBeanAttributeId()).thenReturn(attributeId); when(descriptor.getmBeanAttributeType()).thenReturn(attributeType); when(descriptor.ismBeanAttributeIsIs()).thenReturn(isIs); when(descriptor.ismBeanAttributeIsReadable()).thenReturn(readable); when(descriptor.ismBeanAttributeIsWritable()).thenReturn(writable); boolean added = applier.addMonitoringPoint(agentConfig, descriptor); assertThat(added, is(true)); verify(registrationService).registerJmxSensorDefinitionDataIdent(platformId, objectName, attributeName, attributeDecs, attributeType, isIs, readable, writable); }
assertThat(sensorConfig.getAttributeName(), is(equalTo(testAttributeName))); assertThat(sensorConfig.getmBeanAttributeDescription(), is(equalTo(testAttrDescription))); assertThat(sensorConfig.getmBeanAttributeType(), is(equalTo(testAttrType))); assertThat(sensorConfig.ismBeanAttributeIsIs(), is(equalTo(testAttrIsIs))); assertThat(sensorConfig.ismBeanAttributeIsReadable(), is(equalTo(testAttrIsReadable)));
assertThat(sensorConfig.getAttributeName(), is(equalTo(testAttributeName))); assertThat(sensorConfig.getmBeanAttributeDescription(), is(equalTo(testAttrDescription))); assertThat(sensorConfig.getmBeanAttributeType(), is(equalTo(testAttrType))); assertThat(sensorConfig.ismBeanAttributeIsIs(), is(equalTo(testAttrIsIs))); assertThat(sensorConfig.ismBeanAttributeIsReadable(), is(equalTo(testAttrIsReadable)));
String attributeName = jmxAttributeDescriptor.getAttributeName(); String description = jmxAttributeDescriptor.getmBeanAttributeDescription(); String type = jmxAttributeDescriptor.getmBeanAttributeType(); boolean isIs = jmxAttributeDescriptor.ismBeanAttributeIsIs(); boolean readable = jmxAttributeDescriptor.ismBeanAttributeIsReadable();