[
https://issues.apache.org/jira/browse/FLINK-28404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17562636#comment-17562636
]
zl commented on FLINK-28404:
----------------------------
For example, ReactiveModeITCase use {{RestClusterClient}} to get job details,
See
[ReactiveModeITCase.java#L202|https://github.com/apache/flink/blob/a89152713aa58647841c46ed2335b45d24c553f9/flink-tests/src/test/java/org/apache/flink/test/scheduling/ReactiveModeITCase.java#L202].
when we port ReactiveModeITCase to junit5, we would need inject
{{RestClusterClient.}}
And [MiniClusterExtension.java#L107
|https://github.com/apache/flink/blob/master/flink-test-utils-parent/flink-test-utils/src/main/java/org/apache/flink/test/junit5/MiniClusterExtension.java#L107]provides
an example about how to inject RestClusterClient, but it does not work well.
> 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: zl
> Priority: Major
>
> *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)