Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-28404

Annotation @InjectClusterClient does not work correctly with RestClusterClient

    XMLWordPrintableJSON

Details

    Description

      test code:

      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();
          }
      } 

      error info:

      org.junit.jupiter.api.extension.ParameterResolutionException: No ParameterResolver registered for parameter [org.apache.flink.client.program.rest.RestClusterClient<?> arg0] in method... 

      this problem occurs because MiniClusterExtension#supportsParameter does not support RestClusterClient parameterType. 

      Attachments

        Issue Links

          Activity

            People

              chesnay Chesnay Schepler
              Leo Zhou zhouli
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: