Skip to content

COG-1144: W0 smoke suite for appointment create/list/confirm - #108

Open
patrickbradley-cog wants to merge 1 commit into
devin/cog-1141-w0-testcontainers-mysql-harness-for-springboottest-boot-154from
devin/cog-1144-w0-smoke-suite-appointment-create-and-confirm
Open

patrickbradley-cog wants to merge 1 commit into
devin/cog-1141-w0-testcontainers-mysql-harness-for-springboottest-boot-154from
devin/cog-1144-w0-smoke-suite-appointment-create-and-confirm

Conversation

@patrickbradley-cog

@patrickbradley-cog patrickbradley-cog commented Sep 24, 2026 •

Copy link
Copy Markdown

Summary

Smoke tests for the appointment endpoints, part of the Boot 1.5.4 → 4.1 migration (COG-1144). Stacked on #335 (COG-1141 Testcontainers harness). This PR targets that branch so the diff contains only this ticket's test. It will be retargeted to master once #335 merges.

Rebased onto the canonical harness. The PR's own copies of AbstractIntegrationTest, the UserFrontApplicationTests change and the pom test dependencies (Testcontainers 1.20.6, spring-security-test) are dropped. The only file left is AppointmentSmokeTest extends AbstractIntegrationTest, which uses the inherited mockMvc. No production code changes.

Coverage is unchanged (all 4 tests pass against today's 1.5.4 behaviour):

  • POST /appointment/create using the datetime-picker format, with the lenient SimpleDateFormat("yyyy-MM-dd hh:mm") results pinned:
    "2016-10-21 15:25" -> 15:25
    "2016-10-21 12:30" -> 00:30   // noon becomes midnight
    
  • GET /api/appointment/all as ROLE_ADMIN
  • GET /api/appointment/{id}/confirm as ROLE_ADMIN → 200. The request lives in a single confirm(id) helper. When COG-1153: AppointmentResource.confirm → POST (server + AdminPortal caller) #336 (COG-1153, confirm → POST) lands, whichever of the two PRs merges second changes that helper and the expected status.

Test data is kept separate from the sibling smoke suites. The user is now apptsmoke-user / apptsmoke-user@[REDACTED SECRET].com; before, it was the smokeuser that #109 also creates. latestAppointment() also only looks at this user's appointments. The known static account-number counter bug (COG-1179) never fires here: the user is created once through UserService.createUser against a new per-JVM container, and no account rows are inserted directly.

Verification (Temurin 1.8.0_504, Docker 29.7.2)

mvn -B -f UserFront/pom.xml clean verify, this branch only:

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0 - in com.userFront.AppointmentSmokeTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 - in com.userFront.UserFrontApplicationTests
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

Same command with the sibling suites copied in locally and not committed (AuthSmokeTest from COG-1142, MoneyMovementSmokeTest from COG-1143), all in one JVM:

Tests run: 9, Failures: 0, Errors: 0, Skipped: 0 - in com.userFront.MoneyMovementSmokeTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0 - in com.userFront.AppointmentSmokeTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 - in com.userFront.UserFrontApplicationTests
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0 - in com.userFront.AuthSmokeTest
Tests run: 19, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/3458130a8d5d4e9b996031fa9ec32800
Open in Devin Desktop: https://app.devin.ai/desktop/session/3458130a8d5d4e9b996031fa9ec32800?variant=devin
Requested by: @patrickbradley-cog


Devin Review

Status Commit
⚪ Not started —

Run Devin Review

Devin Review (Staging)


Devin Review

@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Devin Review

Comment on lines +65 to +70
public void createsAppointmentFromThymeleafForm() throws Exception {
mockMvc.perform(post("/appointment/create")
.param("dateString", "2016-10-21 15:25")
.param("location", "Boston")
.param("description", "Smoke test appointment")
.with(user(USERNAME).roles("USER")))

@devin-ai-integration devin-ai-integration Bot Sep 24, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Form smoke test skips browser submission

MockMvc posts form fields directly, so it never exercises the date picker or confirmation callback that submits the browser form. A broken client-side submission can leave these tests green.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Intentional — COG-1144 asks for server-side smoke coverage of the controller's date parsing. The picker format is pinned by sending exactly what main.js emits; client-side submission is out of scope here.

Comment on lines +102 to +104
mockMvc.perform(get("/api/appointment/all").with(user("admin").roles("ADMIN")))
.andExpect(status().isOk())
.andExpect(jsonPath("$[?(@.id == " + appointment.getId() + ")].location").value("New York"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Admin tests use synthetic authentication

user("admin").roles("ADMIN") bypasses database-backed admin login. The tests exercise endpoint authorization, but cannot detect broken admin account or role loading.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deliberate: these tests are the migration regression contract for the appointment endpoints, so they assert route/verb/role behaviour, not admin account provisioning. A DB-backed admin login belongs in a separate auth smoke test.

…shared Testcontainers harness

Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/cog-1144-w0-smoke-suite-appointment-create-and-confirm branch from ca07a9c to 90a5636 Compare September 30, 2026 16:27
@devin-ai-integration
devin-ai-integration Bot changed the base branch from master to devin/cog-1141-w0-testcontainers-mysql-harness-for-springboottest-boot-154 September 30, 2026 16:27
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.

1 participant