@Test
public void testReadFile() {

    long reqId = 1;
    BinaryRawWriterEx message = createMessage(reqId, ModelStorateThinClientProcessor.PROCESSOR_ID, ModelStorateThinClientProcessor.Method.READ_FILE);
    message.writeString(pathToFile1);
    ClientCustomQueryRequest req = new ClientCustomQueryRequest(toReader(message));
    ClientResponse resp = req.process(connCtx);
    assertArrayEquals(file1, ((FileRespose)resp).getData());
    BinaryRawWriterEx out = createWriter();
    resp.encode(connCtx, out);
    byte[] result = out.out().arrayCopy();
    BinaryRawWriterEx expectedOut = getExpectedMessageHeader(reqId);
    expectedOut.writeByteArray(file1);
    byte[] expected = expectedOut.out().arrayCopy();
    assertArrayEquals(expected, result);
}