You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Chesnay Schepler (Jira)" <ji...@apache.org> on 2022/07/06 08:57:00 UTC

[jira] [Comment Edited] (FLINK-28404) Annotation @InjectClusterClient does not work correctly with RestClusterClient

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

Chesnay Schepler edited comment on FLINK-28404 at 7/6/22 8:56 AM:
------------------------------------------------------------------

master: 85ba36fc0123852a9dbc8663ea786f96682f1128

1.15: ef84a060b4e4b82c209080ac0963cacb0be9f05f


was (Author: zentol):
master: 85ba36fc0123852a9dbc8663ea786f96682f1128

> Annotation @InjectClusterClient does not work correctly with RestClusterClient
> ------------------------------------------------------------------------------
>
>                 Key: FLINK-28404
>                 URL: https://issues.apache.org/jira/browse/FLINK-28404
>             Project: Flink
>          Issue Type: Bug
>          Components: Tests
>            Reporter: zhouli
>            Assignee: Chesnay Schepler
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.16.0, 1.15.2
>
>
> *test code:*
> {code:java}
> public class Test {
>     @RegisterExtension
>     private static final MiniClusterExtension MINI_CLUSTER_RESOURCE =
>             new MiniClusterExtension(
>                     new MiniClusterResourceConfiguration.Builder()
>                             .setNumberTaskManagers(1)
>                             .setNumberSlotsPerTaskManager(4)
>                             .build());
>     @org.junit.jupiter.api.Test
>     void test(@InjectClusterClient RestClusterClient<?> restClusterClient) throws Exception {
>         Object clusterId = restClusterClient.getClusterId();
>     }
> } {code}
> *error info:*
> {code:java}
> org.junit.jupiter.api.extension.ParameterResolutionException: No ParameterResolver registered for parameter [org.apache.flink.client.program.rest.RestClusterClient<?> arg0] in method... {code}
> this problem occurs because [MiniClusterExtension#supportsParameter|https://github.com/apache/flink/blob/master/flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/test/junit5/MiniClusterExtension.java#L168] does not support *_RestClusterClient_* parameterType. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)