Github user aljoscha commented on a diff in the pull request:
https://github.com/apache/flink/pull/5732#discussion_r176220108
--- Diff:
flink-core/src/test/java/org/apache/flink/api/common/state/ReducingStateDescriptorTest.java
---
@@ -118,17 +115,14 @@ public void testValueStateDescriptorAutoSerializer()
throws Exception {
@SuppressWarnings("unchecked")
@Test
public void testSerializerDuplication() {
- TypeSerializer<String> statefulSerializer =
mock(TypeSerializer.class);
- when(statefulSerializer.duplicate()).thenAnswer(new
Answer<TypeSerializer<String>>() {
- @Override
- public TypeSerializer<String> answer(InvocationOnMock
invocation) throws Throwable {
- return mock(TypeSerializer.class);
- }
- });
-
- ReduceFunction<String> reducer = mock(ReduceFunction.class);
-
- ReducingStateDescriptor<String> descr = new
ReducingStateDescriptor<>("foobar", reducer, statefulSerializer);
+ // we need a serializer that actually duplicates for testing (a
stateful one)
--- End diff --
See above
---