@Test public void publish_settings_prefixed_with_sonar_analysis_for_webhooks() { props.put("foo", "should not be exported"); props.put("sonar.analysis.revision", "ab45b3"); props.put("sonar.analysis.build.number", "B123"); underTest.publish(writer); List<ScannerReport.ContextProperty> expected = Arrays.asList( newContextProperty("sonar.analysis.revision", "ab45b3"), newContextProperty("sonar.analysis.build.number", "B123")); expectWritten(expected); }
@Test public void publish_writes_no_properties_to_report() { underTest.publish(writer); expectWritten(emptyList()); }
@Test public void publish_writes_properties_to_report() { cache.put("foo1", "bar1"); cache.put("foo2", "bar2"); underTest.publish(writer); List<ScannerReport.ContextProperty> expected = Arrays.asList( newContextProperty("foo1", "bar1"), newContextProperty("foo2", "bar2")); expectWritten(expected); }