Skip to content

Commit

Permalink
Fix Lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
Mansi-mParticle committed Dec 11, 2024
1 parent f6cb98f commit fde1b04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ open class BaseHandler : Handler {
}
}


fun await(latch: CountDownLatch?) {
this.sendMessage(obtainMessage(-1, latch))
}
Expand All @@ -44,8 +43,8 @@ open class BaseHandler : Handler {
}
handling = true
try {
messageQueue.remove(msg)
if ( msg.what == -1 && msg.obj is CountDownLatch) {
messageQueue.remove(msg)
if (msg.what == -1 && msg.obj is CountDownLatch) {
(msg.obj as CountDownLatch).countDown()
} else {
if (isEnabled) {
Expand All @@ -70,7 +69,7 @@ open class BaseHandler : Handler {
listener.onThreadMessage(javaClass.name, msg, false)
}

messageQueue[msg] = true
messageQueue[msg] = true

return super.sendMessageAtTime(msg, uptimeMillis)
}
Expand All @@ -87,7 +86,7 @@ open class BaseHandler : Handler {
super.removeMessages(what)
}

//Override this in order to handle messages
// Override this in order to handle messages
open fun handleMessageImpl(msg: Message?) {
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.mparticle.internal

import android.bluetooth.BluetoothAdapter
import android.content.Context
import android.os.Handler
import android.os.Looper
import android.os.Message
import com.mparticle.MParticle
import com.mparticle.MockMParticle
Expand Down Expand Up @@ -120,9 +117,11 @@ class UploadHandlerTest {
fun testRampSampling() {
val message = Mockito.mock(Message::class.java)

Mockito.`when`(message.toString()).thenAnswer(Answer {
"Mocked Message"
})
Mockito.`when`(message.toString()).thenAnswer(
Answer {
"Mocked Message"
}
)

handler.handleMessage(message)
val apiClient = Mockito.mock(
Expand Down

0 comments on commit fde1b04

Please sign in to comment.