Skip to content

test: assert deleted user returns 404 once - #345

Merged
fjlopez merged 1 commit into
devfrom
test/313-user-delete-404
Oct 21, 2026
Merged

fjlopez merged 1 commit into
devfrom
test/313-user-delete-404

Conversation

@fjlopez

@fjlopez fjlopez commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Why

User create and delete ran twice: UserResourceTest.createUser on MockMvc and UserResourceIntegrationTest.createNewUserAndDelete on a real server. Only the server test asserted that GET after delete returns 404, so a broken create or delete failed both.

What changed

UserResourceTest.createUser now GETs the created user after delete and expects 404. The real-server copy of that create and delete is removed. cannotPostWithoutLogin and getAllUsers stay.

Scope

Tests and the [Unreleased] changelog. No production code, API, or schema change.

Blast Radius

The deleted-user 404 check remains, on the MockMvc test. Unauthenticated user creation and the user list stay on the real server.

Verification

  • Java 17: ./gradlew test --tests org.sitmun.domain.user.UserResourceTest --tests org.sitmun.domain.user.UserResourceIntegrationTest passed, including POST: Create a new user and GET after delete returns 404.
  • Pre-commit hook passed: spotlessCheck, full ./gradlew test, and jacocoTestReport.

Fixes #313

@fjlopez
fjlopez merged commit 38a2f9b into dev Oct 21, 2026
1 check passed
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