@Test public void pathResolvesToNullInMessage() { JsonKeyEncoder encoder = new JsonKeyEncoder(() -> KeyPathParser.parse("$.c"), random); assertThat(encoder.encode(message), is(asBytes(message.get("c").hashCode()))); }
byte[] encode(final JsonNode record) { return ByteBuffer.allocate(Integer.BYTES).putInt(hasherSupplier.get().apply(record)).array(); }
JsonKeyEncoder { byte[] encode(final JsonNode record) { return ByteBuffer.allocate(Integer.BYTES).putInt(hasherSupplier.get().apply(record)).array(); } }
JsonKeyEncoder { byte[] encode(final JsonNode record) { return ByteBuffer.allocate(Integer.BYTES).putInt(hasherSupplier.get().apply(record)).array(); } JsonKeyEncoder(Supplier<Path> pathSupplier); @VisibleForTesting  JsonKeyEncoder(Supplier<Path> pathSupplier, Random random); }
JsonKeyEncoder { byte[] encode(final JsonNode record) { return ByteBuffer.allocate(Integer.BYTES).putInt(hasherSupplier.get().apply(record)).array(); } JsonKeyEncoder(Supplier<Path> pathSupplier); @VisibleForTesting  JsonKeyEncoder(Supplier<Path> pathSupplier, Random random);  }
JsonKeyEncoder { byte[] encode(final JsonNode record) { return ByteBuffer.allocate(Integer.BYTES).putInt(hasherSupplier.get().apply(record)).array(); } JsonKeyEncoder(Supplier<Path> pathSupplier); @VisibleForTesting  JsonKeyEncoder(Supplier<Path> pathSupplier, Random random);   }