Skip to content

Commit

Permalink
feat: scenario parameter read-only api
Browse files Browse the repository at this point in the history
  • Loading branch information
bbortt committed Oct 29, 2023
1 parent 22f05c1 commit 6dfe64d
Show file tree
Hide file tree
Showing 84 changed files with 3,032 additions and 402 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import org.citrusframework.http.client.HttpClient;
import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.sample.model.QueryParameter;
import org.citrusframework.simulator.sample.model.Variable;
import org.citrusframework.simulator.sample.scenario.CalculateIban;
Expand Down Expand Up @@ -79,7 +78,7 @@ public Collection<ScenarioParameter> getScenarioParameters() {
List<ScenarioParameter> scenarioParameters = new ArrayList<>();

// bank account (text box)
scenarioParameters.add(new ScenarioParameterBuilder()
scenarioParameters.add(ScenarioParameter.builder()
.name(Variable.ACCOUNT.name())
.label("Bank Account")
.required()
Expand All @@ -88,7 +87,7 @@ public Collection<ScenarioParameter> getScenarioParameters() {
.build());

// sort code (text box)
scenarioParameters.add(new ScenarioParameterBuilder()
scenarioParameters.add(ScenarioParameter.builder()
.name(Variable.SORT_CODE.name())
.label("Sort Code")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@

package org.citrusframework.simulator.sample.starter;

import java.util.ArrayList;
import java.util.List;

import org.citrusframework.http.client.HttpClient;
import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.sample.model.QueryParameter;
import org.citrusframework.simulator.sample.model.Variable;
import org.citrusframework.simulator.sample.scenario.ValidateIban;
Expand All @@ -32,6 +28,9 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;

import java.util.ArrayList;
import java.util.List;

import static org.citrusframework.actions.EchoAction.Builder.echo;
import static org.citrusframework.http.actions.HttpActionBuilder.http;

Expand Down Expand Up @@ -76,7 +75,7 @@ public List<ScenarioParameter> getScenarioParameters() {
List<ScenarioParameter> scenarioParameters = new ArrayList<>();

// iban (text box)
scenarioParameters.add(new ScenarioParameterBuilder()
scenarioParameters.add(ScenarioParameter.builder()
.name(Variable.IBAN.name())
.label("IBAN")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.List;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.scenario.AbstractScenarioStarter;
import org.citrusframework.simulator.scenario.ScenarioRunner;
import org.citrusframework.simulator.scenario.Starter;
Expand Down Expand Up @@ -49,7 +48,7 @@ public Collection<ScenarioParameter> getScenarioParameters() {
List<ScenarioParameter> scenarioParameters = new ArrayList<>();

// greeting (text area)
scenarioParameters.add(new ScenarioParameterBuilder()
scenarioParameters.add(ScenarioParameter.builder()
.name("payload")
.label("Payload")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.List;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.scenario.AbstractScenarioStarter;
import org.citrusframework.simulator.scenario.ScenarioRunner;
import org.citrusframework.simulator.scenario.Starter;
Expand Down Expand Up @@ -49,7 +48,7 @@ public List<ScenarioParameter> getScenarioParameters() {
List<ScenarioParameter> scenarioParameters = new ArrayList<>();

// name (text box)
scenarioParameters.add(new ScenarioParameterBuilder()
scenarioParameters.add(ScenarioParameter.builder()
.name("greeting")
.label("Greeting Text")
.required()
Expand All @@ -58,7 +57,7 @@ public List<ScenarioParameter> getScenarioParameters() {
.build());

// greeting (text area)
scenarioParameters.add(new ScenarioParameterBuilder()
scenarioParameters.add(ScenarioParameter.builder()
.name("payload")
.label("Payload")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.citrusframework.simulator.sample.jms.async.variables;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;

import java.util.UUID;

Expand All @@ -44,7 +43,7 @@ public String getValue() {
}

public ScenarioParameter asScenarioParameter() {
return new ScenarioParameterBuilder()
return ScenarioParameter.builder()
.name(REFERENCE_ID_VAR)
.label("Reference Id")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.citrusframework.simulator.sample.jms.async.variables;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.sample.jms.async.model.FaxStatusEnumType;

/**
Expand All @@ -37,7 +36,7 @@ public FaxStatusEnumType getValue() {
}

public ScenarioParameter asScenarioParameter() {
ScenarioParameterBuilder statusParameterBuilder = new ScenarioParameterBuilder()
ScenarioParameter.ScenarioParameterBuilder statusParameterBuilder = ScenarioParameter.builder()
.name(Variables.STATUS_VAR)
.label("Fax Status")
.required()
Expand All @@ -47,6 +46,7 @@ public ScenarioParameter asScenarioParameter() {
for (FaxStatusEnumType value : FaxStatusEnumType.values()) {
statusParameterBuilder.addOption(value.value(), value.value());
}

return statusParameterBuilder.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.citrusframework.simulator.sample.jms.async.variables;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;

import static org.citrusframework.simulator.sample.jms.async.variables.Variables.STATUS_MESSAGE_VAR;

Expand All @@ -38,7 +37,7 @@ public String getValue() {
}

public ScenarioParameter asScenarioParameter() {
ScenarioParameterBuilder statusMessageParameterBuilder = new ScenarioParameterBuilder()
ScenarioParameter.ScenarioParameterBuilder statusMessageParameterBuilder = ScenarioParameter.builder()
.name(STATUS_MESSAGE_VAR)
.label("Status Message")
.optional()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.List;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.scenario.AbstractScenarioStarter;
import org.citrusframework.simulator.scenario.ScenarioRunner;
import org.citrusframework.simulator.scenario.Starter;
Expand Down Expand Up @@ -49,7 +48,7 @@ public List<ScenarioParameter> getScenarioParameters() {
List<ScenarioParameter> scenarioParameter = new ArrayList<>();

// payload (text area)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("payload")
.label("Payload")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.List;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.scenario.AbstractScenarioStarter;
import org.citrusframework.simulator.scenario.ScenarioRunner;
import org.citrusframework.simulator.scenario.Starter;
Expand Down Expand Up @@ -49,7 +48,7 @@ public List<ScenarioParameter> getScenarioParameters() {
List<ScenarioParameter> scenarioParameter = new ArrayList<>();

// greeting (text box)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("greeting")
.label("Greeting Text")
.required()
Expand All @@ -58,7 +57,7 @@ public List<ScenarioParameter> getScenarioParameters() {
.build());

// payload (text area)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("payload")
.label("Payload")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.List;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.scenario.AbstractScenarioStarter;
import org.citrusframework.simulator.scenario.ScenarioRunner;
import org.citrusframework.simulator.scenario.Starter;
Expand Down Expand Up @@ -49,7 +48,7 @@ public List<ScenarioParameter> getScenarioParameters() {
List<ScenarioParameter> scenarioParameter = new ArrayList<>();

// payload (text area)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("payload")
.label("Payload")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.List;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.scenario.AbstractScenarioStarter;
import org.citrusframework.simulator.scenario.ScenarioRunner;
import org.citrusframework.simulator.scenario.Starter;
Expand Down Expand Up @@ -49,7 +48,7 @@ public List<ScenarioParameter> getScenarioParameters() {
List<ScenarioParameter> scenarioParameter = new ArrayList<>();

// greeting (text box)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("greeting")
.label("Greeting Text")
.required()
Expand All @@ -58,7 +57,7 @@ public List<ScenarioParameter> getScenarioParameters() {
.build());

// payload (text area)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("payload")
.label("Payload")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.List;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.scenario.AbstractScenarioStarter;
import org.citrusframework.simulator.scenario.ScenarioRunner;
import org.citrusframework.simulator.scenario.Starter;
Expand Down Expand Up @@ -50,7 +49,7 @@ public Collection<ScenarioParameter> getScenarioParameters() {
List<ScenarioParameter> scenarioParameter = new ArrayList<>();

// greeting (text area)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("payload")
.label("Payload")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.List;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.scenario.AbstractScenarioStarter;
import org.citrusframework.simulator.scenario.ScenarioRunner;
import org.citrusframework.simulator.scenario.Starter;
Expand Down Expand Up @@ -49,7 +48,7 @@ public List<ScenarioParameter> getScenarioParameters() {
List<ScenarioParameter> scenarioParameter = new ArrayList<>();

// name (text box)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("greeting")
.label("Greeting Text")
.required()
Expand All @@ -58,7 +57,7 @@ public List<ScenarioParameter> getScenarioParameters() {
.build());

// greeting (text area)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("payload")
.label("Payload")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.citrusframework.simulator.sample.variables;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;

import java.util.UUID;

Expand All @@ -44,7 +43,7 @@ public String getValue() {
}

public ScenarioParameter asScenarioParameter() {
return new ScenarioParameterBuilder()
return ScenarioParameter.builder()
.name(NAME_VAR)
.label("Enter your name")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.List;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.scenario.AbstractScenarioStarter;
import org.citrusframework.simulator.scenario.ScenarioRunner;
import org.citrusframework.simulator.scenario.Starter;
Expand Down Expand Up @@ -50,7 +49,7 @@ public Collection<ScenarioParameter> getScenarioParameters() {
List<ScenarioParameter> scenarioParameter = new ArrayList<>();

// name (text box)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("name")
.label("Name")
.required()
Expand All @@ -59,7 +58,7 @@ public Collection<ScenarioParameter> getScenarioParameters() {
.build());

// greeting (text area)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("payload")
.label("Payload")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.List;

import org.citrusframework.simulator.model.ScenarioParameter;
import org.citrusframework.simulator.model.ScenarioParameterBuilder;
import org.citrusframework.simulator.scenario.AbstractScenarioStarter;
import org.citrusframework.simulator.scenario.ScenarioRunner;
import org.citrusframework.simulator.scenario.Starter;
Expand All @@ -45,7 +44,7 @@ public Collection<ScenarioParameter> getScenarioParameters() {
List<ScenarioParameter> scenarioParameter = new ArrayList<>();

// title (dropdown)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("title")
.label("Title")
.required()
Expand All @@ -57,7 +56,7 @@ public Collection<ScenarioParameter> getScenarioParameters() {
.build());

// firstname (text box)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("firstname")
.label("First Name")
.required()
Expand All @@ -66,7 +65,7 @@ public Collection<ScenarioParameter> getScenarioParameters() {
.build());

// lastname (text box)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("lastname")
.label("Last Name")
.required()
Expand All @@ -76,7 +75,7 @@ public Collection<ScenarioParameter> getScenarioParameters() {


// greeting (text area)
scenarioParameter.add(new ScenarioParameterBuilder()
scenarioParameter.add(ScenarioParameter.builder()
.name("greeting")
.label("Greeting")
.required()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class Message extends AbstractAuditingEntity<Message, Long> implements Se
/**
* Actual direction as a numerical representation of {@link Direction}
*/
@NotNull
@Column(nullable = false, updatable = false)
private Integer direction = Direction.UNKNOWN.getId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import jakarta.persistence.OneToMany;
import jakarta.persistence.OrderBy;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import org.springframework.util.StringUtils;

Expand Down Expand Up @@ -66,6 +67,7 @@ public class ScenarioExecution implements Serializable {
/**
* Actual status as a numerical representation of {@link Status}
*/
@NotNull
@Column(nullable = false)
private Integer status = Status.UNKNOWN.getId();

Expand Down
Loading

0 comments on commit 6dfe64d

Please sign in to comment.