Ivan
03/22/2024, 5:37 PMio.grpc.StatusRuntimeException: UNKNOWN: HTTP status code 200
invalid content-type: null
headers: Metadata(:status=200,grpc-status-name=OK,matched-stub-id=00e9561b-a02a-4553-bf36-6be6d397766e)
DATA-----------------------------
{
}
DATA-----------------------------
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:268)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:249)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:167)
My stub is the following one:
private final WireMockGrpcService wireMockGrpcService =
new WireMockGrpcService(
new WireMock(getPort()),
UnaryEnvelopeRelayServiceGrpc.SERVICE_NAME
);
private ManagedChannel channel;
@BeforeEach
void init() {
channel = ManagedChannelBuilder.forAddress("localhost", getPort()).usePlaintext().build();
enricherClient = new EnricherClient(UnaryEnvelopeRelayServiceGrpc.newBlockingStub(channel));
}
@AfterEach
void tearDown() {
channel.shutdown();
}
@Test
void should_return_failure_when_initiation_fails() {
wireMockGrpcService.stubFor(
method("relay")
.willReturn(message(Envelope.newBuilder().build())));
Any idea what could be causing this issue?