File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
src/main/kotlin/misk/clustering/weights Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ public abstract interface class misk/clustering/weights/ClusterWeightProvider {
223
223
public abstract interface class misk/clustering/weights/ClusterWeightService : com/google/common/util/concurrent/Service {
224
224
}
225
225
226
- public final class misk/clustering/weights/FakeClusterWeight : misk/clustering/weights/ClusterWeightProvider {
226
+ public final class misk/clustering/weights/FakeClusterWeight : misk/testing/FakeFixture, misk/ clustering/weights/ClusterWeightProvider {
227
227
public fun <init> ()V
228
228
public fun get ()I
229
229
public final fun setClusterWeight (I)V
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ dependencies {
22
22
implementation(project(" :misk-backoff" ))
23
23
implementation(project(" :misk-lease" ))
24
24
implementation(project(" :misk-service" ))
25
- implementation (project(" :misk-testing-api" ))
25
+ api (project(" :misk-testing-api" ))
26
26
27
27
testImplementation(libs.assertj)
28
28
testImplementation(libs.junitApi)
Original file line number Diff line number Diff line change 1
1
package misk.clustering.weights
2
2
3
3
import misk.inject.KAbstractModule
4
+ import misk.testing.FakeFixture
5
+ import misk.testing.TestFixture
4
6
5
7
/* *
6
8
* A [ClusterWeightProvider] for testing
7
9
*/
8
- class FakeClusterWeight : ClusterWeightProvider {
10
+ class FakeClusterWeight : ClusterWeightProvider , FakeFixture () {
9
11
10
- private var weight = 100
12
+ private var weight by resettable { 100 }
11
13
12
14
override fun get (): Int {
13
15
return weight
@@ -25,6 +27,7 @@ class FakeClusterWeightModule : KAbstractModule() {
25
27
override fun configure () {
26
28
val fake = FakeClusterWeight ()
27
29
bind<FakeClusterWeight >().toInstance(fake)
30
+ multibind<TestFixture >().to<FakeClusterWeight >()
28
31
bind<ClusterWeightProvider >().toInstance(fake)
29
32
install(NoOpClusterWeightServiceModule ())
30
33
}
You can’t perform that action at this time.
0 commit comments