Skip to content

Commit fc95454

Browse files
authored
Improve an error message of the Spring Monitor test (Azure#36533)
1 parent c6644b4 commit fc95454

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sdk/spring/spring-cloud-azure-starter-monitor-test/src/test/java/com/azure/SpringMonitorTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import java.net.URL;
1313
import java.util.List;
1414
import java.util.concurrent.CountDownLatch;
15+
import java.util.stream.Collectors;
16+
1517
import org.junit.jupiter.api.Test;
1618
import org.springframework.beans.factory.annotation.Autowired;
1719
import org.springframework.boot.test.context.SpringBootTest;
@@ -63,7 +65,9 @@ public void shouldMonitor() throws InterruptedException, MalformedURLException {
6365
.isEqualTo(new URL("https://test.in.applicationinsights.azure.com/v2.1/track"));
6466

6567
List<TelemetryItem> telemetryItems = customValidationPolicy.actualTelemetryItems;
66-
assertThat(telemetryItems.size()).isEqualTo(5);
68+
List<String> telemetryTypes =
69+
telemetryItems.stream().map(telemetry -> telemetry.getName()).collect(Collectors.toList());
70+
assertThat(telemetryItems.size()).as("Telemetry: " + telemetryTypes).isEqualTo(5);
6771

6872
// Log telemetry
6973
TelemetryItem telemetry1 = telemetryItems.get(0);

0 commit comments

Comments
 (0)