集成 grpc 测试的 StatusRuntimeException

问题描述 投票:0回答:0

我尝试用

spring boot project
为我的
grpc
编写集成测试,但是当我运行我的测试时出现这个错误:

io.grpc.StatusRuntimeException: UNKNOWN
    at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262)
    at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243)
    at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156)
    at com.life.api.v1.MyServiceGrpc$MyServiceBlockingStub.create(MyServiceGrpc.java:316)

对于测试我使用

DockerImageName
PostgreSQLContainer

private static final DockerImageName IMAGE_NAME = DockerImageName.parse(fullImageName)
        .asCompatibleSubstituteFor("postgres");

@Container
public static PostgreSQLContainer<?> POSTGRES_CONTAINER = new PostgreSQLContainer<>(IMAGE_NAME)
        .withDatabaseName("user")
        .withUsername("user")
        .withPassword("user");

对于这个异常,我什至不明白应该往哪个方向去尝试寻找错误。也许有人已经遇到过这个或者至少可以说出这可能是什么。

java spring grpc docker-container
© www.soinside.com 2019 - 2024. All rights reserved.