Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open api scenario generator #315

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bbortt
Copy link
Collaborator

@bbortt bbortt commented Nov 24, 2024

@@ -37,6 +38,7 @@
* @author Christoph Deppisch
*/
@Test
@Ignore
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this should be reverted

OpenApiServerResponseActionBuilder sendMessageBuilder = openApiServerActionBuilder.send(
oasOperation.operationId, "200").enableRandomGeneration(false);
sendMessageBuilder.message().body(format("{\"id\": %d, \"pingTime\": %d}",
getIdFromPingRequest(receivedMessage), System.currentTimeMillis()));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
getIdFromPingRequest(receivedMessage), System.currentTimeMillis()));
getIdFromPingRequest(receivedMessage), currentTimeMillis()));

please use static import for this.

@Bean
public HttpClient petstoreClientV3() {
return CitrusEndpoints.http().client()
.requestUrl(String.format("http://localhost:%s/petstore/api/v3", 8080))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
.requestUrl(String.format("http://localhost:%s/petstore/api/v3", 8080))
.requestUrl(format("http://localhost:%s/petstore/api/v3", 8080))

.header("Ping-Time", "@isNumber()@")
.validate(jsonPath()
.expression("$.id", "5000")
.expression("$.pingCount", "@greaterThan("+expectedPingLimit+")@"))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this file needs a ctrl+alt + l. there are some static imports that could be adjusted as well, e.g. MediaType and HttpStatus.

private List<HttpScenario> filterScenarios(Collection<SimulatorScenario> allScenarios) {
return allScenarios.stream().filter(HttpScenario.class::isInstance)
.map(HttpScenario.class::cast)
.sorted(new HttpPathSpecificityComparator())
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

couldn't this be a singleton? why is it stateful? I think the initialization per request could have performance impact. correct me if I am wrong!

@tschlat tschlat force-pushed the issue/285/open_api_scenario_generator_TS_2 branch from c65e307 to 3bd51b8 Compare November 25, 2024 13:57
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