Skip to content

Commit

Permalink
chore: add to changelog and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kmruiz committed Jun 11, 2024
1 parent 938387f commit 5c0095e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ MongoDB plugin for IntelliJ IDEA.
## [Unreleased]

### Added
* [INTELLIJ-11](https://jira.mongodb.org/browse/INTELLIJ-11): Flush pending analytics events before closing the IDE.

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ internal class TelemetryService : AppLifecycleListener {

init {
ApplicationManager.getApplication()
.messageBus
.connect()
.subscribe(
AppLifecycleListener.TOPIC,
this
)
.messageBus
.connect()
.subscribe(
AppLifecycleListener.TOPIC,
this
)
}

fun sendEvent(event: TelemetryEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ inline fun <reified S : ComponentManager, reified T> S.withMockedService(service
*
* ```kt
* val myInfoService = mockRuntimeInformationService(userId = "hey")
* val myProject = mockProject(runtimeInformationService = myInfoService)
* project.withMockedService(myInfoService)
* ```
*
* @param userId
Expand All @@ -120,8 +120,7 @@ internal fun mockRuntimeInformationService(
jvmVersion: String = "42",
buildVersion: String = "2024.2",
applicationName: String = "Cool IDE"
): RuntimeInformationService = org.mockito.kotlin.mock<RuntimeInformationService>()
.also { service ->
) = mock<RuntimeInformationService>().also { service ->
`when`(service.get()).thenReturn(
RuntimeInformation(
userId = userId,
Expand All @@ -142,13 +141,12 @@ internal fun mockRuntimeInformationService(
*
* ```kt
* val myLogMessage = mockLogMessage()
* val myProject = mockProject(logMessage = myLogMessage)
* project.withMockedService(myLogMessage)
* ```
*
* @return A new mocked LogMessage
*/
internal fun mockLogMessage(): LogMessage = org.mockito.kotlin.mock<LogMessage>()
.also { logMessage ->
internal fun mockLogMessage() = mock<LogMessage>().also { logMessage ->
`when`(logMessage.message(any())).then { message ->
LogMessageBuilder(Gson(), message.arguments[0].toString())
}
Expand Down

0 comments on commit 5c0095e

Please sign in to comment.