Skip to content

IGNITE-27994 Create CLI command for REST endpoint to edit cluster name#7740

Open
adityamukho wants to merge 8 commits intoapache:mainfrom
gridgain:ignite-27994
Open

IGNITE-27994 Create CLI command for REST endpoint to edit cluster name#7740
adityamukho wants to merge 8 commits intoapache:mainfrom
gridgain:ignite-27994

Conversation

@adityamukho
Copy link
Contributor

/**
* Tests for {@link ClusterRenameCall}.
*/
public class ItRenameCallTest extends CliIntegrationTest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class ItRenameCallTest extends CliIntegrationTest {
public class ItClusterRenameCallTest extends CliIntegrationTest {

}
}

private DefaultCallOutput<String> updateClusterConfig(ClusterManagementApi api, ClusterRenameCallInput input)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would inline these methods


try {
return updateClusterConfig(client, input);
} catch (ApiException | IllegalArgumentException e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} catch (ApiException | IllegalArgumentException e) {
} catch (ApiException) {

don't see where would illegal argument come from

import picocli.CommandLine.Parameters;

/**
* Mixin class for cluster name option in REPL mode.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Mixin class for cluster name option in REPL mode.
* Mixin class for cluster name.

)
private String name;

private String nameFromArgs() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we really need to provide both options (--name / just as an arg)

/**
* Tests for {@link ClusterRenameCall}.
*/
public class ItRenameCallTest extends CliIntegrationTest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed with Vadim Pakhnushev, there is no point in separate tests for calls. Please replace with a test for command

ALso we need tests for different cases. Quoted, unquoted, empty name, etc


/** Name that will be updated. */
@Mixin
private ClusterNameMixin nameFromArgs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private ClusterNameMixin nameFromArgs;
private ClusterNameMixin name;

import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

class RenameTest extends CliCommandTestBase {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class RenameTest extends CliCommandTestBase {
class ClusterRenameCommandTest extends CliCommandTestBase {


private static Stream<Arguments> calls() {
return Stream.of(
arguments(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why one case?

Class<IT> callInputClass,
Function<IT, String> nameFunction
) {
checkParameters(command, callClass, callInputClass, nameFunction, "test1 test2", "test1 test2");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use parameterizedtest to unite these tests, passing args / expected name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants