Skip to content

feat(gatling): improve Gatling integration#32657

Open
CharlesWong wants to merge 1 commit intojhipster:mainfrom
CharlesWong:feat/improve-gatling-integration
Open

feat(gatling): improve Gatling integration#32657
CharlesWong wants to merge 1 commit intojhipster:mainfrom
CharlesWong:feat/improve-gatling-integration

Conversation

@CharlesWong
Copy link

Improvements to Gatling integration

Addresses the concerns raised in #13390.

Changes

1. Documentation improvements (README.md template)

  • Fixed incorrect language reference: "Scala" → "Java" (JHipster 7+ generates Java-based Gatling tests)
  • Added microservice-specific note explaining that tests must target the gateway (especially for OAuth2, where microservices are resource-servers only)
  • Added instructions for overriding the base URL at runtime via -DbaseURL=...
  • Added instructions for controlling load via -Dusers=N -Dramp=S
  • Added links to Gatling Maven and Gradle plugin documentation

2. Microservices support fixes (simulation template)

  • For microservice applications, the default baseURL now points to the gateway (http://localhost:${gatewayServerPort}) instead of the microservice port. This is the root cause of the authentication failure in Improve Gatling integration #13390 — microservices cannot issue OAuth2 tokens, only the gateway can
  • Introduced an apiPrefix variable (/services/<baseName> for microservices, "" for monoliths/gateways) to replace verbose inline conditionals throughout the scenario

3. Simulation quality improvements

  • Switched from headerRegex("Location", "(.*)") to header("Location") for capturing the created entity URL (simpler and more correct)
  • Added .check(status().is(204)) on DELETE requests to properly assert successful deletion
  • Fixed a comment typo: "css or css" → "css or js"
  • Improved Javadoc with @code and @pre blocks showing runtime configuration options

Testing

These changes are template-level fixes. The existing snapshot tests cover the default (non-microservice) config and are not affected. Microservice scenarios with OAuth2 will now correctly target the gateway for authentication.

Closes #13390

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Gatling integration

1 participant