[ 
https://issues.apache.org/jira/browse/FLINK-6803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16036281#comment-16036281
 ] 

ASF GitHub Bot commented on FLINK-6803:
---------------------------------------

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

    https://github.com/apache/flink/pull/4044#discussion_r120007888
  
    --- Diff: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/util/AbstractStreamOperatorTestHarness.java
 ---
    @@ -192,7 +187,7 @@ public StreamStatus getStreamStatus() {
                
when(mockTask.getTaskConfiguration()).thenReturn(underlyingConfig);
                when(mockTask.getEnvironment()).thenReturn(environment);
                when(mockTask.getExecutionConfig()).thenReturn(executionConfig);
    -           
when(mockTask.getUserCodeClassLoader()).thenReturn(this.getClass().getClassLoader());
    +           
when(mockTask.getUserCodeClassLoader()).thenReturn(environment.getUserClassLoader());
    --- End diff --
    
    Some tests are failing because of this change.
    
    I think the problem is because the given environment may also be a mock 
whose stubbing isn't completed yet, leading to a 
`org.mockito.exceptions.misusing.UnfinishedStubbingException`.
    
    We can avoid that by doing this:
    ```
    ClassLoader cl = environment.getUserClassLoader();
    when(mockTask.getUserCodeClassLoader()).thenReturn(cl);
    ```


> Add test for PojoSerializer when Pojo changes
> ---------------------------------------------
>
>                 Key: FLINK-6803
>                 URL: https://issues.apache.org/jira/browse/FLINK-6803
>             Project: Flink
>          Issue Type: Improvement
>          Components: Type Serialization System
>    Affects Versions: 1.4.0
>            Reporter: Till Rohrmann
>            Assignee: Till Rohrmann
>
> We should add test cases for the {{PojoSerializer}} when the underlying Pojo 
> type changes in order to test the proper behaviour of the serializer.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to