Skip to content

refactor: restore DepartmentName enum and add FixtureMonkey-based member registration tests#195

Open
hyunbin1 wants to merge 4 commits intomainfrom
codex/add-integration-tests-for-registration-api
Open

refactor: restore DepartmentName enum and add FixtureMonkey-based member registration tests#195
hyunbin1 wants to merge 4 commits intomainfrom
codex/add-integration-tests-for-registration-api

Conversation

@hyunbin1
Copy link
Member

Motivation

  • Previous change added a College field to DepartmentName which would require updates across domain logic, so the enum was restored to its original single-argument form to avoid wide ripples.
  • Test data generation and combination logic were previously scattered or hardcoded, making maintenance difficult when adding/removing departments.
  • Use FixtureMonkey to centralize and simplify creation of valid and invalid request DTOs so tests focus on verification rather than data construction.

Description

  • Reverted DepartmentName to the original signature with a single label field to keep domain compatibility (src/main/java/.../DepartmentName.java).
  • Added CollegeDepartmentTestData to hold test-only mappings of College -> valid DepartmentName sets and to provide a stream of valid pairs (src/test/java/.../CollegeDepartmentTestData.java).
  • Added MemberRegistrationRequestFixture using FixtureMonkey to produce valid and invalid MemberRegistrationRequestDTO instances for tests (src/test/java/.../MemberRegistrationRequestFixture.java).
  • Added MemberControllerRegistrationIntegrationTest as a parameterized WebMvc test that iterates valid college/department pairs to assert 201 Created and a negative case asserting 400 Bad Request for invalid student number format (src/test/java/.../MemberControllerRegistrationIntegrationTest.java).
  • Kept FixtureMonkey as a test dependency in build.gradle so tests can use FixtureMonkey builders.

Testing

  • Ran ./gradlew --version (with JAVA_HOME set to a Java 17 installation) to ensure Gradle and JVM compatibility, which completed successfully.
  • Attempted ./gradlew test --tests "*MemberControllerRegistrationIntegrationTest" (with JAVA_HOME set to Java 17) and the test run failed because Gradle could not resolve the org.springframework.boot plugin due to network restrictions (HTTP 403) when accessing plugin/maven repositories, so the integration tests could not be executed in this environment.

Codex Task

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant