Skip to content

Commit

Permalink
fix(simulator-spring-boot): indicate simulation failure with http status
Browse files Browse the repository at this point in the history
  • Loading branch information
bbortt committed May 12, 2024
1 parent 4e42ef3 commit b22be63
Show file tree
Hide file tree
Showing 116 changed files with 593 additions and 489 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class DefaultScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.receive();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class GoodByeScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.receive()
.payload("<GoodBye xmlns=\"http://citrusframework.org/schemas/hello\">" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class GoodNightScenario extends AbstractSimulatorScenario {
private static final String CORRELATION_ID = "correlationId";

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.receive()
.payload("<GoodNight xmlns=\"http://citrusframework.org/schemas/hello\">" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class HelloScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.echo("Simulator: ${simulator.name}");

scenario
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class GoodByeStarter extends AbstractScenarioStarter {
private TemplateService templateService;

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.echo("GoodBye starter was executed!");
scenario.echo("${payload}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class HelloStarter extends AbstractScenarioStarter {
private TemplateService templateService;

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.echo("${greeting}");
scenario.echo("${payload}");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
info.simulator.name=JMS Simulator
logging.level.org.citrusframework=INFO

# Enable JMS support
citrus.simulator.jms.enabled=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class DefaultScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.receive();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class GoodByeScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.receive()
.payload("<mail-message xmlns=\"http://www.citrusframework.org/schema/mail/message\">" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class GoodNightScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.receive()
.payload("<mail-message xmlns=\"http://www.citrusframework.org/schema/mail/message\">" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class HelloScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.echo("Simulator: ${simulator.name}");

scenario
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class GoodByeStarter extends AbstractScenarioStarter {
private TemplateService templateService;

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.echo("GoodBye starter was executed!");
scenario.echo("${payload}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class HelloStarter extends AbstractScenarioStarter {
private TemplateService templateService;

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.echo("${greeting}");
scenario.echo("${payload}");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
info.simulator.name=Mail Server Simulator
logging.level.org.citrusframework=INFO

# Enable Mail endpoint support
citrus.simulator.endpoint.enabled=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class DefaultScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.receive();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class GoodByeScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.http()
.receive()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class GoodNightScenario extends AbstractSimulatorScenario {
private static final String CORRELATION_ID = "x-correlationid";

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.http()
.receive()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class HelloScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.echo("Simulator: ${simulator.name}");

scenario
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class GoodByeStarter extends AbstractScenarioStarter {
private TemplateService templateService;

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.echo("GoodBye starter was executed!");
scenario.echo("${payload}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class HelloStarter extends AbstractScenarioStarter {
private TemplateService templateService;

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.echo("${greeting}");
scenario.echo("${payload}");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
info.simulator.name=REST Simulator
logging.level.org.citrusframework=INFO

# Enable Http REST support
citrus.simulator.rest.enabled=true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
info.simulator.name=REST Petstore Simulator
logging.level.org.citrusframework=INFO

# Enable Http REST support
citrus.simulator.rest.enabled=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class DefaultScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.soap()
.sendFault()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class GoodByeScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.soap()
.receive()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public class GoodNightScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.correlation().start()
.withHandler(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class HelloScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.soap()
.receive()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class GoodByeStarter extends AbstractScenarioStarter {
private TemplateService templateService;

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.echo("GoodBye starter was executed!");
scenario.echo("${payload}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class HelloStarter extends AbstractScenarioStarter {
private TemplateService templateService;

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.echo("${title} ${firstname} ${lastname} ");
scenario.echo("${greeting}");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
info.simulator.name=SOAP Simulator
logging.level.org.citrusframework=INFO

# Enable SOAP web service support
citrus.simulator.ws.enabled=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class DefaultScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario
.soap()
.sendFault()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
info.simulator.name=SOAP WSDL Simulator
logging.level.org.citrusframework=INFO

# Enable SOAP web service support
citrus.simulator.ws.enabled=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public CalculateIban(BankService bankService, QueryParameterService queryParamet
}

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(scenario.http()
.receive()
.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
public class DefaultScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(scenario.receive());

scenario.$(scenario.http()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public ValidateIban(BankService bankService, QueryParameterService queryParamete
}

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(scenario.http()
.receive()
.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public CalculateStarter(@Qualifier("simulatorHttpClientEndpoint") HttpClient cli
}

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(echo("Sending request to Calculate-IBAN REST Service..."));

scenario.$(http().client(client)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public ValidateStarter(@Qualifier("simulatorHttpClientEndpoint") HttpClient clie
}

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(echo("Sending request to Validate-IBAN REST Service..."));

scenario.$(http().client(client)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
info.simulator.name=Citrus Bank Simulator
logging.level.org.citrusframework=INFO

# SSL Configuration for HTTPS endpoint
server.port=8443
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class DefaultScenario extends AbstractSimulatorScenario {
private static final Logger logger = LoggerFactory.getLogger(DefaultScenario.class);

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
boolean isSoap = false;
try {
scenario.$(scenario.receive());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
public class GoodByeScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(scenario.receive()
.message()
.body("<GoodBye xmlns=\"http://citrusframework.org/schemas/hello\">" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class GoodNightScenario extends AbstractSimulatorScenario {
private static final String JMS_CORRELATION_ID = "x_correlationid";

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(scenario.receive()
.message()
.validate((message, context) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class HelloScenario extends AbstractSimulatorScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(echo("Simulator: ${simulator.name}"));

scenario.$(scenario.receive()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class GoodByeStarter extends AbstractScenarioStarter {
private TemplateService templateService;

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(echo("GoodBye starter was executed!"));
scenario.$(echo("${payload}"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class HelloStarter extends AbstractScenarioStarter {
private TemplateService templateService;

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(echo("${greeting}"));
scenario.$(echo("${payload}"));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
info.simulator.name=Combined REST and JMS Simulator

logging.level.org.citrusframework=INFO

# Enable Http REST and JMS support
citrus.simulator.rest.enabled=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class FaxBusyScenario extends AbstractFaxScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(scenario.receive()
.message()
.validate(xpath().expression(Variables.ROOT_ELEMENT_XPATH, "SendFaxMessage"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class FaxCancelledScenario extends AbstractFaxScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(scenario.receive()
.message()
.validate(xpath().expression(Variables.ROOT_ELEMENT_XPATH, "SendFaxMessage"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public class FaxNoAnswerScenario extends AbstractFaxScenario {

@Override
public void run(ScenarioRunner scenario) {
public void runScenario(ScenarioRunner scenario) {
scenario.$(scenario.receive()
.message()
.validate(xpath().expression(Variables.ROOT_ELEMENT_XPATH, "SendFaxMessage"))
Expand Down
Loading

0 comments on commit b22be63

Please sign in to comment.