/** * Verifies that for the given {@code Coder<T>}, and value of type {@code T}, encoding followed by * decoding yields an equal value of type {@code T}, in any {@code Coder.Context}. */ public static <T> void coderDecodeEncodeEqual(Coder<T> coder, T value) throws Exception { for (Coder.Context context : ALL_CONTEXTS) { coderDecodeEncodeEqualInContext(coder, context, value); } }
@Test public void testSubcoderRecievesEntireStream() throws Exception { NullableCoder<String> coder = NullableCoder.of(new EntireStreamExpectingCoder()); CoderProperties.coderDecodeEncodeEqualInContext(coder, Context.OUTER, null); CoderProperties.coderDecodeEncodeEqualInContext(coder, Context.OUTER, "foo"); }