Github user bowenli86 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5032#discussion_r152348905
  
    --- 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 --
    
    LGTM!
    
    Just wondering which will throw the exception? `getMapState()` or 
`getListState()`? If the former, then we don't need the latter one here.


---

Reply via email to