Github user bowenli86 commented on a diff in the pull request:
https://github.com/apache/flink/pull/5032#discussion_r152475532
--- Diff:
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/operators/StreamingRuntimeContextTest.java
---
@@ -270,6 +271,20 @@ public void testMapStateReturnsEmptyMapByDefault()
throws Exception {
assertFalse(value.iterator().hasNext());
}
+ @Test(expected = DuplicateStateNameException.class)
+ public void testDuplicateStateName() throws Exception {
+ StreamingRuntimeContext context = new StreamingRuntimeContext(
+ createMapPlainMockOp(),
+ createMockEnvironment(),
+ Collections.emptyMap());
+ MapStateDescriptor<Integer, String> mapStateDesc =
+ new MapStateDescriptor<>("name", Integer.class,
String.class);
+ ListStateDescriptor<String> listStateDesc =
+ new ListStateDescriptor<>("name", String.class);
+ context.getMapState(mapStateDesc);
--- End diff --
This is good enough ð
---