Skip to content

Commit

Permalink
Bind FakeTokenGenerator to TestFixture
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 324e25aa359307a94c893d4c5ba9584c239001fa
  • Loading branch information
katukota authored and svc-squareup-copybara committed Feb 11, 2025
1 parent 8a41324 commit 125d5c8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class FakeTokenGeneratorModule : KAbstractModule() {
override fun configure() {
bind<TokenGenerator>().to<FakeTokenGenerator>()
multibind<TestFixture>().to<FakeTokenGenerator>()
multibind<TestFixture>().to<wisp.token.FakeTokenGenerator>()
bind<TokenGenerator2>().to<FakeTokenGenerator2>()
}
}
1 change: 1 addition & 0 deletions wisp/wisp-token-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies {
api(project(":wisp:wisp-token"))
api(project(":misk-testing-api"))

api(libs.jakartaInject)
testImplementation(libs.kotestAssertionsShared)
testImplementation(libs.kotestCommon)
testImplementation(libs.kotestFrameworkApi)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import wisp.token.TokenGenerator.Companion.CANONICALIZE_LENGTH_MIN
import wisp.token.TokenGenerator.Companion.canonicalize
import java.util.*
import java.util.concurrent.atomic.AtomicLong
import jakarta.inject.Inject

class FakeTokenGenerator : FakeFixture(), TokenGenerator {
class FakeTokenGenerator @Inject constructor(): FakeFixture(), TokenGenerator {
internal val nextByLabel by resettable {
Collections.synchronizedMap<String, AtomicLong>(
mutableMapOf()
Expand Down

0 comments on commit 125d5c8

Please sign in to comment.