assertArrayEquals(expected, bytes);
}
@Test
public void testAddToByteArrayLongToIntToString() throws CruxException {
ValueType valueType = new ValueType();
// int to string
valueType.setClassName("java.lang.Integer");
byte[] bytes = BytesHelper.addToByteArray(valueType, "10",
Bytes.toBytes("I am a string"));
byte[] expected = Bytes.add(Bytes.toBytes("I am a string"),
Bytes.toBytes(10));
assertArrayEquals(expected, bytes);
// long to above
valueType.setClassName("java.lang.Long");
expected = Bytes.add(bytes, Bytes.toBytes(100l));
bytes = BytesHelper.addToByteArray(valueType, "100", bytes);
assertArrayEquals(expected, bytes);
}