@Test void whenDescribeCalledThenSensorDescriptionIsWritten() { final SensorDescriptor mockDescriptor = mock(SensorDescriptor.class); when(mockDescriptor.onlyOnLanguage(anyString())).thenReturn(mockDescriptor); pmdSensor.describe(mockDescriptor); verify(mockDescriptor).onlyOnLanguage(PmdConstants.LANGUAGE_KEY); verify(mockDescriptor).name("PmdSensor"); }
@Override public void describe(SensorDescriptor descriptor) { descriptor.onlyOnLanguage(PmdConstants.LANGUAGE_KEY) .name("PmdSensor"); }
PmdSensor implements Sensor { @Override public void describe(SensorDescriptor descriptor) { descriptor.onlyOnLanguage(PmdConstants.LANGUAGE_KEY) .name("PmdSensor"); } }
PmdSensor implements Sensor { @Override public void describe(SensorDescriptor descriptor) { descriptor.onlyOnLanguage(PmdConstants.LANGUAGE_KEY) .name("PmdSensor"); } PmdSensor(ActiveRules profile, PmdExecutor executor, PmdViolationRecorder pmdViolationRecorder, FileSystem fs); }
PmdSensor implements Sensor { @Override public void describe(SensorDescriptor descriptor) { descriptor.onlyOnLanguage(PmdConstants.LANGUAGE_KEY) .name("PmdSensor"); } PmdSensor(ActiveRules profile, PmdExecutor executor, PmdViolationRecorder pmdViolationRecorder, FileSystem fs); @Override String toString(); @Override void describe(SensorDescriptor descriptor); @Override void execute(SensorContext context); }
PmdSensor implements Sensor { @Override public void describe(SensorDescriptor descriptor) { descriptor.onlyOnLanguage(PmdConstants.LANGUAGE_KEY) .name("PmdSensor"); } PmdSensor(ActiveRules profile, PmdExecutor executor, PmdViolationRecorder pmdViolationRecorder, FileSystem fs); @Override String toString(); @Override void describe(SensorDescriptor descriptor); @Override void execute(SensorContext context);  }