*/
public final class FieldListEncoderJUnitTest {
@Test
public void ensureTranslationWorks() {
List<Field> fields = Arrays.asList(new Field("name", SimpleTypes.STRING), new Field("description", SimpleTypes.STRING));
String s = FieldListEncoder.encode(fields);
List<Field> decoded = FieldListEncoder.decode(s);
// XXX: Field.equals only looks at the name, not the type, so we cannot use List.equals here.
assertEquals(fields.size(), decoded.size());
for (int n = 0; n < fields.size(); ++n) {
Field f1 = fields.get(n);
Field f2 = decoded.get(n);
assertNotSame(f1, f2);
assertEquals(f1.getName(), f2.getName());
assertEquals(f1.getTypeName(), f2.getTypeName());
}
}