File tree 2 files changed +7
-3
lines changed
stub/src/test/java/io/grpc/kotlin
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -149,14 +149,16 @@ abstract class AbstractCallsTest {
149
149
}
150
150
151
151
/* * Generates a channel to a Greeter server with the specified implementation. */
152
- fun makeChannel (impl : BindableService ): ManagedChannel {
152
+ fun makeChannel (impl : BindableService , vararg interceptors : ServerInterceptor ): ManagedChannel {
153
153
val serverName = InProcessServerBuilder .generateName()
154
154
155
155
grpcCleanup.register(
156
156
InProcessServerBuilder .forName(serverName)
157
157
.run { this as ServerBuilder <* > } // workaround b/123879662
158
158
.executor(executor)
159
- .addService(impl)
159
+ .addService(
160
+ ServerInterceptors .intercept(impl, * interceptors)
161
+ )
160
162
.build()
161
163
.start()
162
164
)
@@ -188,6 +190,9 @@ abstract class AbstractCallsTest {
188
190
}
189
191
)
190
192
193
+ fun makeChannel (impl : ServerServiceDefinition ? , vararg interceptors : ServerInterceptor ): ManagedChannel =
194
+ makeChannel(BindableService { impl }, * interceptors)
195
+
191
196
fun <R > runBlocking (block : suspend CoroutineScope .() -> R ): Unit =
192
197
kotlinx.coroutines.runBlocking(context) {
193
198
block()
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import kotlin.coroutines.coroutineContext
16
16
import io.grpc.Metadata as GrpcMetadata
17
17
18
18
/* * Tests for [CoroutineContextServerInterceptor]. */
19
- @RunWith(JUnit4 ::class ) /* inserted by Copybara: */ @com.google.testing.testsize.MediumTest
20
19
class CoroutineContextServerInterceptorTest : AbstractCallsTest () {
21
20
class ArbitraryContextElement (val message : String = " " ) : CoroutineContext.Element {
22
21
companion object Key : CoroutineContext.Key<ArbitraryContextElement>
You can’t perform that action at this time.
0 commit comments