jetbrains-core/tst/software/aws/toolkits/jetbrains/services/telemetry/DefaultTelemetryPublisherTest.kt [38:100]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - val mockPostMetricsRequestCaptor = argumentCaptor() val mockTelemetryClient = delegateMock() val publisher = DefaultTelemetryPublisher( clientMetadata = clientMetadata, client = mockTelemetryClient ) runBlocking { publisher.publish( listOf( DefaultMetricEvent.builder() .awsAccount("111111111111") .awsRegion("us-west-2") .datum("foobar") { this.count() } .build(), DefaultMetricEvent.builder() .awsAccount("111111111111") .awsRegion("us-west-2") .datum("spam") { this.count() } .build() ) ) } verify(mockTelemetryClient, times(1)).postMetrics(mockPostMetricsRequestCaptor.capture()) val postMetricsRequest = mockPostMetricsRequestCaptor.firstValue assertThat(postMetricsRequest.awsProduct()).isEqualTo(AWSProduct.AWS_TOOLKIT_FOR_JET_BRAINS) assertThat(postMetricsRequest.awsProductVersion()).isEqualTo("1.0") assertThat(postMetricsRequest.clientID()).isEqualTo("foo") assertThat(postMetricsRequest.parentProduct()).isEqualTo("JetBrains") assertThat(postMetricsRequest.parentProductVersion()).isEqualTo("191") assertThat(postMetricsRequest.os()).isEqualTo("mac") assertThat(postMetricsRequest.osVersion()).isEqualTo("1.0") assertThat(postMetricsRequest.metricData()).hasSize(2) postMetricsRequest.metricData()[0].let { assertThat(it.metricName()).isEqualTo("foobar") assertThat(it.metadata()).contains( MetadataEntry.builder() .key("awsAccount") .value("111111111111") .build(), MetadataEntry.builder() .key("awsRegion") .value("us-west-2") .build() ) } postMetricsRequest.metricData()[1].let { assertThat(it.metricName()).isEqualTo("spam") assertThat(it.metadata()).contains( MetadataEntry.builder() .key("awsAccount") .value("111111111111") .build(), MetadataEntry.builder() .key("awsRegion") .value("us-west-2") .build() ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jetbrains-core/tst/software/aws/toolkits/jetbrains/services/telemetry/DefaultTelemetryPublisherTest.kt [106:168]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - val mockPostMetricsRequestCaptor = argumentCaptor() val mockTelemetryClient = delegateMock() val publisher = DefaultTelemetryPublisher( clientMetadata = clientMetadata, client = mockTelemetryClient ) runBlocking { publisher.publish( listOf( DefaultMetricEvent.builder() .awsAccount("111111111111") .awsRegion("us-west-2") .datum("foobar") { this.count() } .build(), DefaultMetricEvent.builder() .awsAccount("111111111111") .awsRegion("us-west-2") .datum("spam") { this.count() } .build() ) ) } verify(mockTelemetryClient, times(1)).postMetrics(mockPostMetricsRequestCaptor.capture()) val postMetricsRequest = mockPostMetricsRequestCaptor.firstValue assertThat(postMetricsRequest.awsProduct()).isEqualTo(AWSProduct.AWS_TOOLKIT_FOR_JET_BRAINS) assertThat(postMetricsRequest.awsProductVersion()).isEqualTo("1.0") assertThat(postMetricsRequest.clientID()).isEqualTo("foo") assertThat(postMetricsRequest.parentProduct()).isEqualTo("JetBrains") assertThat(postMetricsRequest.parentProductVersion()).isEqualTo("191") assertThat(postMetricsRequest.os()).isEqualTo("mac") assertThat(postMetricsRequest.osVersion()).isEqualTo("1.0") assertThat(postMetricsRequest.metricData()).hasSize(2) postMetricsRequest.metricData()[0].let { assertThat(it.metricName()).isEqualTo("foobar") assertThat(it.metadata()).contains( MetadataEntry.builder() .key("awsAccount") .value("111111111111") .build(), MetadataEntry.builder() .key("awsRegion") .value("us-west-2") .build() ) } postMetricsRequest.metricData()[1].let { assertThat(it.metricName()).isEqualTo("spam") assertThat(it.metadata()).contains( MetadataEntry.builder() .key("awsAccount") .value("111111111111") .build(), MetadataEntry.builder() .key("awsRegion") .value("us-west-2") .build() ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -