Skip to content

Commit 3035a9b

Browse files
committed
use existing coder test
1 parent af743fa commit 3035a9b

1 file changed

Lines changed: 3 additions & 28 deletions

File tree

sdks/java/core/src/test/java/org/apache/beam/sdk/util/WindowedValueTest.java

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ public void testWindowedValueWithElementMetadataCoder() throws CoderException {
111111
null,
112112
null,
113113
CausedByDrain.CAUSED_BY_DRAIN,
114-
context); // drain is persisted as part of metadata
114+
context,
115+
ValueKind.DELETE); // drain is persisted as part of metadata
115116

116117
Coder<WindowedValue<String>> windowedValueCoder =
117118
WindowedValues.getFullCoder(StringUtf8Coder.of(), IntervalWindow.getCoder());
@@ -126,33 +127,7 @@ public void testWindowedValueWithElementMetadataCoder() throws CoderException {
126127
Assert.assertArrayEquals(value.getWindows().toArray(), decodedValue.getWindows().toArray());
127128
Assert.assertEquals(CausedByDrain.CAUSED_BY_DRAIN, value.causedByDrain());
128129
Assert.assertNotNull(value.getOpenTelemetryContext());
129-
}
130-
131-
@Test
132-
public void testWindowedValueWithValueKindCoder() throws CoderException {
133-
WindowedValues.WindowedValueCoder.setMetadataSupported();
134-
Instant timestamp = new Instant(1234);
135-
WindowedValue<String> value =
136-
WindowedValues.<String>builder()
137-
.setValue("abc")
138-
.setTimestamp(timestamp)
139-
.setWindows(
140-
Arrays.asList(new IntervalWindow(timestamp, timestamp.plus(Duration.millis(1000)))))
141-
.setPaneInfo(PaneInfo.NO_FIRING)
142-
.setValueKind(ValueKind.UPDATE_BEFORE)
143-
.build();
144-
145-
Coder<WindowedValue<String>> windowedValueCoder =
146-
WindowedValues.getFullCoder(StringUtf8Coder.of(), IntervalWindow.getCoder());
147-
148-
byte[] encodedValue = CoderUtils.encodeToByteArray(windowedValueCoder, value);
149-
WindowedValue<String> decodedValue =
150-
CoderUtils.decodeFromByteArray(windowedValueCoder, encodedValue);
151-
152-
Assert.assertEquals(value.getValue(), decodedValue.getValue());
153-
Assert.assertEquals(value.getTimestamp(), decodedValue.getTimestamp());
154-
Assert.assertArrayEquals(value.getWindows().toArray(), decodedValue.getWindows().toArray());
155-
Assert.assertEquals(value.getValueKind(), decodedValue.getValueKind());
130+
Assert.assertEquals(ValueKind.DELETE, value.getValueKind());
156131
}
157132

158133
@Test

0 commit comments

Comments
 (0)