Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 87f4cfe

Browse files
committed
Change shell commands in tests
- For shell 2.1.0-M5 we need to change some test commands for tasks. Theoretically something we should support what comes for positional parameters and plan is to revisit this later with #4946
1 parent 556ffb1 commit 87f4cfe

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spring-cloud-dataflow-shell-core/src/test/java/org/springframework/cloud/dataflow/shell/command/TaskCommandTemplate.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void create(String taskName, String taskDefinition, Object... values) {
8989
public long launch(String taskName) {
9090
// add the task name to the tasks list before assertion
9191
tasks.add(taskName);
92-
Object result = commandRunner.executeCommand("task launch " + taskName);
92+
Object result = commandRunner.executeCommand("task launch --name " + taskName);
9393
Object idResult = commandRunner.executeCommand("task execution list --name " + taskName);
9494
Table idResultTable = resultAsTable(idResult);
9595

@@ -108,7 +108,7 @@ public long launch(String taskName) {
108108
public long launchWithAlternateCTR(String taskName, String ctrAppName) {
109109
// add the task name to the tasks list before assertion
110110
tasks.add(taskName);
111-
Object result = commandRunner.executeCommand(String.format("task launch %s --composedTaskRunnerName %s", taskName, ctrAppName));
111+
Object result = commandRunner.executeCommand(String.format("task launch --name %s --composedTaskRunnerName %s", taskName, ctrAppName));
112112
Object idResult = commandRunner.executeCommand("task execution list --name " + taskName);
113113
Table idResultTable = resultAsTable(idResult);
114114

@@ -152,7 +152,7 @@ public void getTaskExecutionLogInvalidId() {
152152
private long launchTaskExecutionForLog(String taskName) throws Exception{
153153
// add the task name to the tasks list before assertion
154154
tasks.add(taskName);
155-
Object result = commandRunner.executeCommand(String.format("task launch %s", taskName));
155+
Object result = commandRunner.executeCommand(String.format("task launch --name %s", taskName));
156156
Object idResult = commandRunner.executeCommand("task execution list --name " + taskName);
157157
Table taskExecutionResult = resultAsTable(idResult);
158158

@@ -231,7 +231,7 @@ public Object taskExecutionCurrent() {
231231
* Validates the task definition.
232232
*/
233233
public Object taskValidate(String taskDefinitionName) {
234-
return commandRunner.executeCommand("task validate " + taskDefinitionName);
234+
return commandRunner.executeCommand("task validate --name " + taskDefinitionName);
235235
}
236236

237237
/**
@@ -245,7 +245,7 @@ public Object taskExecutionListByName(String name) {
245245
private void doCreate(String taskName, String taskDefinition, Object... values) {
246246
String actualDefinition = String.format(taskDefinition, values);
247247
// Shell parser expects quotes to be escaped by \
248-
String wholeCommand = String.format("task create %s --definition \"%s\"", taskName,
248+
String wholeCommand = String.format("task create --name \"%s\" --definition \"%s\"", taskName,
249249
actualDefinition.replaceAll("\"", "\\\\\""));
250250
Object result = commandRunner.executeCommand(wholeCommand);
251251

0 commit comments

Comments
 (0)