Configuration getEffectiveConfiguration(String[] args) throws CliArgsException {
        final CommandLine commandLine = cli.parseCommandLineOptions(args, true);
        final Configuration effectiveConfiguration = new Configuration(baseConfiguration);
        effectiveConfiguration.addAll(cli.toConfiguration(commandLine));
        effectiveConfiguration.set(DeploymentOptions.TARGET, KubernetesSessionClusterExecutor.NAME);
        return effectiveConfiguration;
    }
@Test
    void testCorrectSettingOfMaxSlots() throws Exception {
        final String[] params =
                new String[] {
                    "-e",
                    KubernetesSessionClusterExecutor.NAME,
                    "-D" + TaskManagerOptions.NUM_TASK_SLOTS.key() + "=3"
                };

        final KubernetesSessionCli cli = createFlinkKubernetesCustomCliWithJmAndTmTotalMemory(1234);

        final Configuration executorConfig = cli.getEffectiveConfiguration(params);
        final ClusterClientFactory<String> clientFactory = getClusterClientFactory(executorConfig);
        final ClusterSpecification clusterSpecification =
                clientFactory.getClusterSpecification(executorConfig);

        // each task manager has 3 slots but the parallelism is 7. Thus the slots should be
        // increased.
        assertThat(clusterSpecification.getSlotsPerTaskManager()).isEqualTo(3);
    }