[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16641695#comment-16641695 ] ASF GitHub Bot commented on FLINK-10208: zentol closed pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java index 75f3b3df184..3b48f8632da 100644 --- a/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java +++ b/flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java @@ -47,8 +47,8 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; import static org.mockito.Matchers.isNull; import static org.mockito.Mockito.mock; @@ -315,7 +315,7 @@ private static void restoreStdOutAndStdErr() { private static ClusterClient createClusterClient(String expectedResponse) throws Exception { final ClusterClient clusterClient = mock(ClusterClient.class); - when(clusterClient.triggerSavepoint(any(JobID.class), anyString())) + when(clusterClient.triggerSavepoint(any(JobID.class), nullable(String.class))) .thenReturn(CompletableFuture.completedFuture(expectedResponse)); return clusterClient; @@ -324,7 +324,7 @@ private static void restoreStdOutAndStdErr() { private static ClusterClient createFailingClusterClient(Exception expectedException) throws Exception { final ClusterClient clusterClient = mock(ClusterClient.class); - when(clusterClient.triggerSavepoint(any(JobID.class), anyString())) + when(clusterClient.triggerSavepoint(any(JobID.class), nullable(String.class))) .thenReturn(FutureUtils.completedExceptionally(expectedException)); return clusterClient; diff --git a/flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchSinkBaseTest.java b/flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchSinkBaseTest.java index 369d26a735a..322d64cbe0e 100644 --- a/flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchSinkBaseTest.java +++ b/flink-connectors/flink-connector-elasticsearch-base/src/test/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchSinkBaseTest.java @@ -483,7 +483,7 @@ protected BulkProcessor buildBulkProcessor(final BulkProcessor.Listener listener @Override public Object answer(InvocationOnMock invocationOnMock) throws Throwable { // intercept the request and add it to our mock bulk request - nextBulkRequest.add(invocationOnMock.getArgumentAt(0, IndexRequest.class)); + nextBulkRequest.add((IndexRequest) invocationOnMock.getArgument(0)); return null; } diff --git a/flink-connectors/flink-connector-kafka-0.9/src/test/java/org/apache/flink/streaming/connectors/kafka/internal/KafkaConsumerThreadTest.java b/flink-connectors/flink-connector-kafka-0.9/src/test/java/org/apache/flink/streaming/connectors/kafka/internal/KafkaConsumerThreadTest.java index 3d4018714f2..8dbf871ccdb 100644 --- a/flink-connectors/flink-connector-kafka-0.9/src/test/java/org/apache/flink/streaming/connectors/kafka/internal/KafkaConsumerThreadTest.java +++ b/flink-connectors/flink-connector-kafka-0.9/src/test/java/org/apache/flink/streaming/connectors/kafka/internal/KafkaConsumerThreadTest.java @@ -797,7 +797,7 @@ public Object answer(InvocationOnMock invocationOnMock) throws Throwable { when(mockConsumer.position(any(TopicPartition.class))).thenAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocationOnMock) throws Throwable { -
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16635428#comment-16635428 ] ASF GitHub Bot commented on FLINK-10208: zentol commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r221935270 ## File path: pom.xml ## @@ -123,8 +123,8 @@ under the License. 0.3.0 1.8.2 4.12 - 1.10.19 - 1.6.5 + 2.21.0 + 2.0.0-beta.5 Review comment: There's no proper 2.0.0 release yet :/ This is the only version available on maven central, but it's already used a fair bit. https://mvnrepository.com/artifact/org.powermock/powermock-core This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16635397#comment-16635397 ] ASF GitHub Bot commented on FLINK-10208: tillrohrmann commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r221892988 ## File path: pom.xml ## @@ -123,8 +123,8 @@ under the License. 0.3.0 1.8.2 4.12 - 1.10.19 - 1.6.5 + 2.21.0 + 2.0.0-beta.5 Review comment: Why do we need to use the beta version here? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16605616#comment-16605616 ] ASF GitHub Bot commented on FLINK-10208: zentol commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r215578794 ## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/BarrierBufferTestBase.java ## @@ -531,7 +532,7 @@ public void testMultiChannelSkippingCheckpoints() throws Exception { // checkpoint 3 aborted (end of partition) check(sequence[20], buffer.getNextNonBlocked(), PAGE_SIZE); - verify(toNotify).abortCheckpointOnBarrier(eq(3L), any(CheckpointDeclineSubsumedException.class)); + verify(toNotify).abortCheckpointOnBarrier(eq(3L), any(InputEndOfStreamException.class)); Review comment: I supposed we should use `isA` instead. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16605611#comment-16605611 ] ASF GitHub Bot commented on FLINK-10208: zentol commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r215577408 ## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/BarrierBufferTestBase.java ## @@ -531,7 +532,7 @@ public void testMultiChannelSkippingCheckpoints() throws Exception { // checkpoint 3 aborted (end of partition) check(sequence[20], buffer.getNextNonBlocked(), PAGE_SIZE); - verify(toNotify).abortCheckpointOnBarrier(eq(3L), any(CheckpointDeclineSubsumedException.class)); + verify(toNotify).abortCheckpointOnBarrier(eq(3L), any(InputEndOfStreamException.class)); Review comment: alright so we need a matcher that actually checks the class? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16605604#comment-16605604 ] ASF GitHub Bot commented on FLINK-10208: NicoK commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r215573439 ## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/BarrierBufferTestBase.java ## @@ -531,7 +532,7 @@ public void testMultiChannelSkippingCheckpoints() throws Exception { // checkpoint 3 aborted (end of partition) check(sequence[20], buffer.getNextNonBlocked(), PAGE_SIZE); - verify(toNotify).abortCheckpointOnBarrier(eq(3L), any(CheckpointDeclineSubsumedException.class)); + verify(toNotify).abortCheckpointOnBarrier(eq(3L), any(InputEndOfStreamException.class)); Review comment: Actually, that code has been around before @zhijiangW last touched it, but old and new do not actually verify the intended behaviour, i.e. "check that there was a call `abortCheckpointOnBarrier(3L, InputEndOfStreamException)`". If you look at the JavaDocs of `any`, it also reveals why: > Any kind object, not necessary of the given class. > The class argument is provided only to avoid casting. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16598730#comment-16598730 ] ASF GitHub Bot commented on FLINK-10208: TisonKun commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r214349501 ## File path: flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java ## @@ -315,7 +315,7 @@ private static void restoreStdOutAndStdErr() { private static ClusterClient createClusterClient(String expectedResponse) throws Exception { final ClusterClient clusterClient = mock(ClusterClient.class); - when(clusterClient.triggerSavepoint(any(JobID.class), anyString())) + when(clusterClient.triggerSavepoint(any(JobID.class), nullable(String.class))) Review comment: @zentol What is the preference between `nullable()` and `any()`? Inconsistent on this, take a look at `HadoopOutputFormatTest.java` where change `any(FileSystem.class)` to `nullable(FileSystem.class)` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16598719#comment-16598719 ] ASF GitHub Bot commented on FLINK-10208: TisonKun commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r214349501 ## File path: flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java ## @@ -315,7 +315,7 @@ private static void restoreStdOutAndStdErr() { private static ClusterClient createClusterClient(String expectedResponse) throws Exception { final ClusterClient clusterClient = mock(ClusterClient.class); - when(clusterClient.triggerSavepoint(any(JobID.class), anyString())) + when(clusterClient.triggerSavepoint(any(JobID.class), nullable(String.class))) Review comment: @zentol What is the preference between `nullable()` and `any()`? Inconsistent on this, take a look at `HadoopOutputFormatTest.java` where change `any(FileSystem.class)` to `nullable(FileSystem.class)` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16598547#comment-16598547 ] ASF GitHub Bot commented on FLINK-10208: zentol commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r214309889 ## File path: flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/slot/TimerServiceTest.java ## @@ -22,7 +22,7 @@ import org.apache.flink.util.TestLogger; import org.junit.Test; -import org.mockito.internal.util.reflection.Whitebox; +import org.powermock.reflect.Whitebox; Review comment: yes, but it would be out-of-scope of this PR to change other usages. For this test in particular I'll change it to the flink whitebox copy though. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16598484#comment-16598484 ] ASF GitHub Bot commented on FLINK-10208: azagrebin commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r214297157 ## File path: flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/slot/TimerServiceTest.java ## @@ -22,7 +22,7 @@ import org.apache.flink.util.TestLogger; import org.junit.Test; -import org.mockito.internal.util.reflection.Whitebox; +import org.powermock.reflect.Whitebox; Review comment: ok, does it make sense then to use everywhere one thing? e.g. then `flink.Whitebox`? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16597555#comment-16597555 ] ASF GitHub Bot commented on FLINK-10208: zentol commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r214063691 ## File path: flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/slot/TimerServiceTest.java ## @@ -22,7 +22,7 @@ import org.apache.flink.util.TestLogger; import org.junit.Test; -import org.mockito.internal.util.reflection.Whitebox; +import org.powermock.reflect.Whitebox; Review comment: We could, but in the long term I'd like to get rid of powermock completely. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16597542#comment-16597542 ] ASF GitHub Bot commented on FLINK-10208: zentol commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r214063691 ## File path: flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/slot/TimerServiceTest.java ## @@ -22,7 +22,7 @@ import org.apache.flink.util.TestLogger; import org.junit.Test; -import org.mockito.internal.util.reflection.Whitebox; +import org.powermock.reflect.Whitebox; Review comment: We could, but in the long term I'd like to get rid of powermockito completely. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16597541#comment-16597541 ] ASF GitHub Bot commented on FLINK-10208: zentol commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r214063691 ## File path: flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/slot/TimerServiceTest.java ## @@ -22,7 +22,7 @@ import org.apache.flink.util.TestLogger; import org.junit.Test; -import org.mockito.internal.util.reflection.Whitebox; +import org.powermock.reflect.Whitebox; Review comment: We could, but in the long term I'd like to get rid of powermockito directly. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16597496#comment-16597496 ] ASF GitHub Bot commented on FLINK-10208: azagrebin commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r214009807 ## File path: flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/slot/TimerServiceTest.java ## @@ -22,7 +22,7 @@ import org.apache.flink.util.TestLogger; import org.junit.Test; -import org.mockito.internal.util.reflection.Whitebox; +import org.powermock.reflect.Whitebox; Review comment: Can this `org.powermock.reflect.Whitebox` be used everywhere instead of having Flink own Whitebox from old mockito? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16597417#comment-16597417 ] ASF GitHub Bot commented on FLINK-10208: zentol commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r213907252 ## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/BarrierBufferTestBase.java ## @@ -531,7 +532,7 @@ public void testMultiChannelSkippingCheckpoints() throws Exception { // checkpoint 3 aborted (end of partition) check(sequence[20], buffer.getNextNonBlocked(), PAGE_SIZE); - verify(toNotify).abortCheckpointOnBarrier(eq(3L), any(CheckpointDeclineSubsumedException.class)); + verify(toNotify).abortCheckpointOnBarrier(eq(3L), any(InputEndOfStreamException.class)); Review comment: @NicoK @zhijiangW I'd love to get your input here. As far as i can tell the existing code was simple wrong, as this exception wasn't supposed to be thrown in this situation. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16597075#comment-16597075 ] ASF GitHub Bot commented on FLINK-10208: zentol commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r213907317 ## File path: pom.xml ## @@ -171,7 +171,7 @@ under the License. org.mockito - mockito-all Review comment: The mockito-all artifact is no longer distributed. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16597074#comment-16597074 ] ASF GitHub Bot commented on FLINK-10208: zentol commented on a change in pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634#discussion_r213907252 ## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/BarrierBufferTestBase.java ## @@ -531,7 +532,7 @@ public void testMultiChannelSkippingCheckpoints() throws Exception { // checkpoint 3 aborted (end of partition) check(sequence[20], buffer.getNextNonBlocked(), PAGE_SIZE); - verify(toNotify).abortCheckpointOnBarrier(eq(3L), any(CheckpointDeclineSubsumedException.class)); + verify(toNotify).abortCheckpointOnBarrier(eq(3L), any(InputEndOfStreamException.class)); Review comment: @NicoK @zhijiangW I'd love to get your input here. As far as i can tell the existing code was simple wrong, as the supposed exception wasn't supposed to be thrown in this situation. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-10208) Bump mockito to 2.0+
[ https://issues.apache.org/jira/browse/FLINK-10208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16597073#comment-16597073 ] ASF GitHub Bot commented on FLINK-10208: zentol opened a new pull request #6634: [FLINK-10208][build] Bump mockito to 2.21.0 / powermock to 2.0.0-beta.5 URL: https://github.com/apache/flink/pull/6634 ## What is the purpose of the change This PR bumps mockito to 2.21.0 and powermock to 2.0.0-beta.5 for jdk9 compatibility. This is a substantial version, as our current mockito version is 10 years old. As a result a fair number of incompatibilities had to be resolved. I grouped instances of the same issue into single commits, and added a note to each commit as to what has changed. Some of these are rather mechanical (like package changes), while others are pretty subtle (like the exception matching). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Bump mockito to 2.0+ > > > Key: FLINK-10208 > URL: https://issues.apache.org/jira/browse/FLINK-10208 > Project: Flink > Issue Type: Sub-task > Components: Build System, Tests >Affects Versions: 1.7.0 >Reporter: Chesnay Schepler >Assignee: Chesnay Schepler >Priority: Major > Labels: pull-request-available > Fix For: 1.7.0 > > > Mockito only properly supports java 9 with version 2. We have to bump the > dependency and fix various API incompatibilities. > Additionally we could investigate whether we still need powermock after > bumping the dependency (which we'd also have to bump otherwise). -- This message was sent by Atlassian JIRA (v7.6.3#76005)