String tableName = "test";
String primary = "1234";
String familyName = "info";
String columnName = "col";
ReadModel model = ReadModel.SNAPSHOT;
GetAction action = new GetAction(model, tableName, Bytes.toBytes(primary));
action.addEntityColumn(tableName, familyName, columnName, DataType.STRING, null);
action.addEntityColumn(tableName, familyName, columnName, DataType.STRING, null);
GetActionProto proto = ProtobufUtil.toGetActionProto(action);
action = (GetAction) ProtobufUtil.toGetAction(proto);
Assert.assertTrue(model == action.getReaderMode());
Assert.assertTrue(tableName.equals(action.getFTableName()));
Assert.assertTrue(primary.equals(Bytes.toString(action.getCombinedPrimaryKey())));
Assert.assertTrue(action.getColumns().get(0).getFamilyName()
.equals(familyName)
&& action.getColumns().get(0).getColumnName().equals(columnName));
Assert.assertTrue(action.getColumns().get(1).getFamilyName()
.equals(familyName)
&& action.getColumns().get(1).getColumnName().equals(columnName));
}