Streamed boolean values can on be 0 or 1
Original commit: elastic/x-pack-elasticsearch@16ffa0727b
This commit is contained in:
parent
faf54d4952
commit
b97610f245
|
@ -171,8 +171,10 @@ public class MockClientBuilder {
|
||||||
ActionListener<DeleteJobAction.Response> actionListener) throws InterruptedException, ExecutionException, IOException {
|
ActionListener<DeleteJobAction.Response> actionListener) throws InterruptedException, ExecutionException, IOException {
|
||||||
DeleteIndexResponse response = DeleteIndexAction.INSTANCE.newResponse();
|
DeleteIndexResponse response = DeleteIndexAction.INSTANCE.newResponse();
|
||||||
StreamInput si = mock(StreamInput.class);
|
StreamInput si = mock(StreamInput.class);
|
||||||
when(si.readByte()).thenReturn((byte) 0x41);
|
// this looks complicated but Mockito can't mock the final method
|
||||||
when(si.readMap()).thenReturn(mock(Map.class));
|
// DeleteIndexResponse.isAcknowledged() and the only way to create
|
||||||
|
// one with a true response is reading from a stream.
|
||||||
|
when(si.readByte()).thenReturn((byte) 0x01);
|
||||||
response.readFrom(si);
|
response.readFrom(si);
|
||||||
|
|
||||||
doAnswer(invocation -> {
|
doAnswer(invocation -> {
|
||||||
|
|
Loading…
Reference in New Issue