[
https://issues.apache.org/jira/browse/FLINK-8338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16311330#comment-16311330
]
ASF GitHub Bot commented on FLINK-8338:
---------------------------------------
Github user GJL commented on a diff in the pull request:
https://github.com/apache/flink/pull/5224#discussion_r159643583
--- Diff:
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendCancelTest.java
---
@@ -133,19 +139,23 @@ public void testCancelWithSavepointWithoutJobId()
throws Exception {
public void testCancelWithSavepointWithoutParameters() throws Exception
{
// Cancel with savepoint (no target directory) and no job ID
String[] parameters = { "-s" };
- CliFrontend testFrontend = new
CliFrontend(CliFrontendTestUtils.getConfigDir());
+ CliFrontend testFrontend = new CliFrontend(
+ new Configuration(),
+ Collections.singletonList(new DefaultCLI()),
+ CliFrontendTestUtils.getConfigDir());
testFrontend.cancel(parameters);
fail("Should have failed.");
}
- private static final class CancelTestCliFrontend extends
MockedCliFrontend {
+ private static ClusterClient createClusterClient(boolean reject) throws
Exception {
+ final ClusterClient clusterClient = mock(ClusterClient.class);
- CancelTestCliFrontend(boolean reject) throws Exception {
- if (reject) {
- doThrow(new IllegalArgumentException("Test
exception")).when(client).cancel(any(JobID.class));
- doThrow(new IllegalArgumentException("Test
exception")).when(client).cancelWithSavepoint(any(JobID.class), anyString());
- }
+ if (reject) {
+ doThrow(new IllegalArgumentException("Test
exception")).when(clusterClient).cancel(any(JobID.class));
--- End diff --
nit: Code will never run because `reject` is always `false` for all tests.
Original author probably forgot to add some test cases.
> Make CustomCommandLines non static in CliFrontend
> -------------------------------------------------
>
> Key: FLINK-8338
> URL: https://issues.apache.org/jira/browse/FLINK-8338
> Project: Flink
> Issue Type: Sub-task
> Components: Client
> Affects Versions: 1.5.0
> Reporter: Till Rohrmann
> Assignee: Till Rohrmann
> Labels: flip-6
> Fix For: 1.5.0
>
>
> For better testability and maintainability we should make the
> {{CustomCommandLine}} registration non-static in {{CliFrontend}}.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)