MySQLStringLenencBinaryProtocolValue implements MySQLBinaryProtocolValue { @Override public void write(final MySQLPacketPayload payload, final Object value) { if (value instanceof byte[]) { payload.writeBytesLenenc((byte[]) value); } else { payload.writeStringLenenc(value.toString()); } }  @Override Object read(final MySQLPacketPayload payload); @Override void write(final MySQLPacketPayload payload, final Object value);  }
@Test public void assertWriteString() { new MySQLStringLenencBinaryProtocolValue().write(payload, "value"); verify(payload).writeStringLenenc("value"); }
@Test public void assertWriteByteArray() { new MySQLStringLenencBinaryProtocolValue().write(payload, new byte[] {}); verify(payload).writeBytesLenenc(new byte[] {}); }