@Test(expected = NullPointerException.class) public void waitForStatusMessageTimeoutTest() throws InterruptedException, TimeoutException, ExecutionException { when(messageWriter.writeProcessRecordsMessage(any(ProcessRecordsInput.class))).thenReturn(buildFuture(true)); Future<Message> future = Mockito.mock(Future.class); when(messageReader.getNextMessageFromSTDOUT()).thenReturn(future); when(configuration.getTimeoutInSeconds()).thenReturn(5); when(future.get(anyInt(), eq(TimeUnit.SECONDS))).thenThrow(TimeoutException.class); protocol = new MultiLangProtocolForTesting(messageReader, messageWriter, InitializationInput.builder().shardId(shardId).build(), configuration); protocol.processRecords(ProcessRecordsInput.builder().records(EMPTY_RECORD_LIST).build()); }
boolean processRecords(ProcessRecordsInput processRecordsInput) { Future<Boolean> writeFuture = messageWriter.writeProcessRecordsMessage(processRecordsInput); return waitForStatusMessage(ProcessRecordsMessage.ACTION, processRecordsInput.checkpointer(), writeFuture); }
MultiLangProtocol { boolean processRecords(ProcessRecordsInput processRecordsInput) { Future<Boolean> writeFuture = messageWriter.writeProcessRecordsMessage(processRecordsInput); return waitForStatusMessage(ProcessRecordsMessage.ACTION, processRecordsInput.checkpointer(), writeFuture); } }
MultiLangProtocol { boolean processRecords(ProcessRecordsInput processRecordsInput) { Future<Boolean> writeFuture = messageWriter.writeProcessRecordsMessage(processRecordsInput); return waitForStatusMessage(ProcessRecordsMessage.ACTION, processRecordsInput.checkpointer(), writeFuture); } MultiLangProtocol(MessageReader messageReader, MessageWriter messageWriter,
            InitializationInput initializationInput, MultiLangDaemonConfiguration configuration); }
MultiLangProtocol { boolean processRecords(ProcessRecordsInput processRecordsInput) { Future<Boolean> writeFuture = messageWriter.writeProcessRecordsMessage(processRecordsInput); return waitForStatusMessage(ProcessRecordsMessage.ACTION, processRecordsInput.checkpointer(), writeFuture); } MultiLangProtocol(MessageReader messageReader, MessageWriter messageWriter,
            InitializationInput initializationInput, MultiLangDaemonConfiguration configuration);  }
MultiLangProtocol { boolean processRecords(ProcessRecordsInput processRecordsInput) { Future<Boolean> writeFuture = messageWriter.writeProcessRecordsMessage(processRecordsInput); return waitForStatusMessage(ProcessRecordsMessage.ACTION, processRecordsInput.checkpointer(), writeFuture); } MultiLangProtocol(MessageReader messageReader, MessageWriter messageWriter,
            InitializationInput initializationInput, MultiLangDaemonConfiguration configuration);   }