use of org.apache.hadoop.hdds.scm.ByteStringConversion in project ozone by apache.
the class TestContainerUtils method redactsDataBuffers.
@Test
public void redactsDataBuffers() {
// GIVEN
ContainerCommandRequestProto req = getDummyCommandRequestProto(ReadChunk);
ChunkBuffer data = ChunkBuffer.wrap(ByteBuffer.wrap("junk".getBytes(UTF_8)));
ContainerCommandResponseProto resp = getReadChunkResponse(req, data, ByteStringConversion::safeWrap);
// WHEN
ContainerCommandResponseProto processed = processForDebug(resp);
// THEN
ContainerProtos.DataBuffers dataBuffers = processed.getReadChunk().getDataBuffers();
assertEquals(1, dataBuffers.getBuffersCount());
assertEquals("<redacted>", dataBuffers.getBuffers(0).toString(UTF_8));
}
Aggregations