I am trying to test a grpc spring boot service. Ge...
# kotest
s
I am trying to test a grpc spring boot service. Getting
No qualifying bean of type 'org.lognet.springboot.grpc.autoconfigure.GRpcServerProperties'
What am I missing?
Copy code
class CommonSupplyBasicIT2(private val gRpcServerProperties: GRpcServerProperties) : BehaviorSpec() {

    override fun extensions() = listOf(SpringExtension)

    private lateinit var channel: ManagedChannel

    private lateinit var commonSupplyService: CommonSupplyAPIGrpcKt.CommonSupplyAPICoroutineStub

    override fun beforeSpec(spec: Spec) {
        super.beforeSpec(spec)
        BlockHound.install() // Detect blocking calls
        channel = ManagedChannelBuilder
            .forAddress("localhost", gRpcServerProperties.runningPort)
            .usePlaintext()
            .build()
        commonSupplyService = CommonSupplyAPIGrpcKt.CommonSupplyAPICoroutineStub(channel)
    }

    override fun afterSpec(spec: Spec) {
        super.afterSpec(spec)
        channel.shutdownNow()
    }

}
I am able to autowire
GRpcServerProperties
with normal junit5 tests
t
you seem to lack
@SpringBootTest
on top of your class
s
oh thank you!! stupid mistake of mine T.T