Skip to content

Commit 523848a

Browse files
author
Robert von Massow
committed
fix gradle build issues
1 parent ef1b973 commit 523848a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

stub/src/test/java/io/grpc/kotlin/AbstractCallsTest.kt

+7-2
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,16 @@ abstract class AbstractCallsTest {
149149
}
150150

151151
/** 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 {
153153
val serverName = InProcessServerBuilder.generateName()
154154

155155
grpcCleanup.register(
156156
InProcessServerBuilder.forName(serverName)
157157
.run { this as ServerBuilder<*> } // workaround b/123879662
158158
.executor(executor)
159-
.addService(impl)
159+
.addService(
160+
ServerInterceptors.intercept(impl, *interceptors)
161+
)
160162
.build()
161163
.start()
162164
)
@@ -188,6 +190,9 @@ abstract class AbstractCallsTest {
188190
}
189191
)
190192

193+
fun makeChannel(impl: ServerServiceDefinition?, vararg interceptors: ServerInterceptor): ManagedChannel =
194+
makeChannel(BindableService { impl }, *interceptors)
195+
191196
fun <R> runBlocking(block: suspend CoroutineScope.() -> R): Unit =
192197
kotlinx.coroutines.runBlocking(context) {
193198
block()

stub/src/test/java/io/grpc/kotlin/CoroutineContextServerInterceptorTest.kt

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import kotlin.coroutines.coroutineContext
1616
import io.grpc.Metadata as GrpcMetadata
1717

1818
/** Tests for [CoroutineContextServerInterceptor]. */
19-
@RunWith(JUnit4::class) /* inserted by Copybara: */ @com.google.testing.testsize.MediumTest
2019
class CoroutineContextServerInterceptorTest : AbstractCallsTest() {
2120
class ArbitraryContextElement(val message: String = "") : CoroutineContext.Element {
2221
companion object Key : CoroutineContext.Key<ArbitraryContextElement>

0 commit comments

Comments
 (0)