Slackbot
01/23/2024, 11:09 AMTom
01/24/2024, 9:27 AMDaniel Ochoa Rodriguez
01/24/2024, 10:11 AMjava.lang.NullPointerException: Cannot invoke "org.apache.hc.client5.http.io.ManagedHttpClientConnection.isConsistent()" because "conn" is null
at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.release(PoolingHttpClientConnectionManager.java:412)
at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.discardEndpoint(InternalExecRuntime.java:246)
at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.releaseEndpoint(InternalExecRuntime.java:260)
at org.apache.hc.client5.http.impl.classic.ResponseEntityProxy.releaseConnection(ResponseEntityProxy.java:80)
at org.apache.hc.client5.http.impl.classic.ResponseEntityProxy.eofDetected(ResponseEntityProxy.java:115)
at org.apache.hc.core5.http.io.EofSensorInputStream.checkEOF(EofSensorInputStream.java:199)
at org.apache.hc.core5.http.io.EofSensorInputStream.read(EofSensorInputStream.java:136)
at java.base/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:270)
at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:313)
at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
at java.base/java.io.InputStreamReader.read(InputStreamReader.java:177)
at java.base/java.io.Reader.read(Reader.java:250)
at org.apache.hc.core5.http.io.entity.EntityUtils.toCharArrayBuffer(EntityUtils.java:179)
at org.apache.hc.core5.http.io.entity.EntityUtils.toString(EntityUtils.java:222)
at org.apache.hc.core5.http.io.entity.EntityUtils.toString(EntityUtils.java:283)
at org.apache.hc.core5.http.io.entity.EntityUtils.toString(EntityUtils.java:244)
at com.github.tomakehurst.wiremock.common.HttpClientUtils.getEntityAsStringAndCloseStream(HttpClientUtils.java:35)
at com.github.tomakehurst.wiremock.client.HttpAdminClient.safelyExecuteRequest(HttpAdminClient.java:535)
at com.github.tomakehurst.wiremock.client.HttpAdminClient.executeRequest(HttpAdminClient.java:507)
at com.github.tomakehurst.wiremock.client.HttpAdminClient.executeRequest(HttpAdminClient.java:483)
at com.github.tomakehurst.wiremock.client.HttpAdminClient.addStubMapping(HttpAdminClient.java:150)
at com.github.tomakehurst.wiremock.client.WireMock.register(WireMock.java:446)
at org.wiremock.grpc.dsl.WireMockGrpcService.stubFor(WireMockGrpcService.java:39)
Daniel Ochoa Rodriguez
01/24/2024, 10:11 AMTom
01/24/2024, 11:22 AMTom
01/24/2024, 11:22 AMDaniel Ochoa Rodriguez
01/24/2024, 12:21 PMDaniel Ochoa Rodriguez
01/24/2024, 12:21 PMDaniel Ochoa Rodriguez
01/24/2024, 12:22 PMjava.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNIMPLEMENTED: Method not found: google.bytestream.ByteStream/Write
Daniel Ochoa Rodriguez
01/24/2024, 12:22 PMDaniel Ochoa Rodriguez
01/24/2024, 12:22 PM@BeforeEach
void init() {
mockGreetingService =
new WireMockGrpcService(new WireMock(wm.getPort()), ByteStreamGrpc.SERVICE_NAME);
channel = ManagedChannelBuilder.forAddress("localhost", wm.getPort()).usePlaintext().build();
client = ByteStreamGrpc.newStub(channel);
}
@AfterEach
void tearDown() {
channel.shutdown();
}
@Test
public void dynamic_response_via_JSON() {
mockGreetingService.stubFor(
method("write")
.willReturn(message(WriteResponse.newBuilder().setCommittedSize(20).build())));
Ivan
03/22/2024, 5:33 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?Tom
03/24/2024, 7:15 PM