Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class OpenedFileTypesMetricsService : Disposable {
@Synchronized
fun addToExistingTelemetryBatch(fileExt: String) {
if (fileExt in ALLOWED_CODE_EXTENSIONS) {
currentOpenedFileTypes.add(fileExt)
val extension = ".$fileExt"
currentOpenedFileTypes.add(extension)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class OpenedFileTypeMetricsTest {
@Test
fun `test addToExistingTelemetryBatch with allowed extension`() {
service.addToExistingTelemetryBatch("kt")
assert(service.getOpenedFileTypes().contains("kt"))
assert(service.getOpenedFileTypes().contains(".kt"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use assertj

Suggested change
assert(service.getOpenedFileTypes().contains(".kt"))
assertThat(service.getOpenedFileTypes()).contains(".kt")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also lets try to use JUnit5 for new tests

}

@Test
Expand Down
Loading