use of io.datarouter.model.field.imp.comparable.IntegerFieldKey in project datarouter by hotpads.
the class FieldSetToolTests method testGetConcatenatedValueBytes.
@Test
public void testGetConcatenatedValueBytes() {
List<Field<?>> fields = List.of(new IntegerField(new IntegerFieldKey("a"), 55), new StringField(new StringFieldKey("b"), "abc"), new StringField(new StringFieldKey("c"), "xyz"));
int lengthWithout = 4 + 3 + 1 + 3;
int lengthWith = lengthWithout + 1;
Bytes withoutTrailingByte = new Bytes(FieldTool.getConcatenatedValueBytesUnterminated(fields));
Bytes withTrailingByte = new Bytes(FieldTool.getConcatenatedValueBytes(fields));
Assert.assertEquals(withoutTrailingByte.getLength(), lengthWithout);
Assert.assertEquals(withTrailingByte.getLength(), lengthWith);
}
Aggregations