Harden E2E suite and document worklog#129
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0403797d27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ResponseEntity<String> response = restTemplate.postForEntity(endpoint, request, String.class); | ||
|
|
||
| assertThat(response.getStatusCode()) | ||
| .as("CREATE endpoint should return success status") | ||
| .isIn(HttpStatus.CREATED, HttpStatus.OK); | ||
| .as("CREATE endpoint should return HTTP 201") | ||
| .isEqualTo(HttpStatus.CREATED); |
There was a problem hiding this comment.
Avoid asserting POST success for SELECT-only generation
The full-stack E2E still generates the microservice from customer_select.sql (a SELECT statement), and SelectMicroserviceGenerator only produces a GET controller (no POST/PUT/DELETE endpoints). With this new hard assertion of 201 on POST (and the analogous PUT/DELETE methods), the test will now fail with 404/405 even when generation is correct. Consider conditioning CRUD assertions on the detected statement type or generating a CRUD SQL scenario for this test instead of a SELECT-only file.
Useful? React with 👍 / 👎.
| assertThat(response.getBody()) | ||
| .as("DELETE endpoint should confirm deletion") | ||
| .contains("deleted successfully"); |
There was a problem hiding this comment.
Don’t require a body on HTTP 204 deletes
Delete controllers return ResponseEntity.status(NO_CONTENT); by HTTP semantics Spring won’t include a body for 204 responses, so RestTemplate will see null. The new assertion that the body contains "deleted successfully" will fail even on a successful delete. Either assert an empty body for 204 or have the controller return 200 if you need a confirmation string.
Useful? React with 👍 / 👎.
Summary
Changes
SONARCLOUD_FIXES_REPORT.md,e2e-hardening-notes.md,sonarcloud-issues-plan.md, updatedDEVELOPER_GUIDE.mdApiEndpointTester,GeneratedMicroserviceValidator, and database E2E testsApplicationTest,BasicIntegrationTest,CompleteScenarioCoverageTest,ComprehensiveCRUDWorkflowTestJdbcTemplateConfigTest,NamedParameterJdbcTemplateConfigTest, expandedDataSourceConfigTestColumnMetadata,DeleteMetadata,InsertMetadata,UpdateMetadata,DBColumn,TableColumnTest plan
🤖 Generated with Claude Code