test(web): added search controller test #38

Merged
devitq merged 1 commits from test/film-controller-search-test into develop 2026-05-03 19:29:04 +00:00
devitq commented 2026-05-03 19:26:08 +00:00 (Migrated from github.com)
No description provided.
coderabbitai[bot] commented 2026-05-03 19:26:15 +00:00 (Migrated from github.com)

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Free

Run ID: dc33b175-6339-4f0e-90b4-a1e372d83fa3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

<!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- This is an auto-generated comment: skip review by coderabbit.ai --> > [!IMPORTANT] > ## Review skipped > > Auto reviews are disabled on base/target branches other than the default branch. > > > > Please check the settings in the CodeRabbit UI or the `.coderabbit.yaml` file in this repository. To trigger a single review, invoke the `@coderabbitai review` command. > > <details> > <summary>⚙️ Run configuration</summary> > > **Configuration used**: Organization UI > > **Review profile**: ASSERTIVE > > **Plan**: Free > > **Run ID**: `dc33b175-6339-4f0e-90b4-a1e372d83fa3` > > </details> > > You can disable this status message by setting the `reviews.review_status` to `false` in the CodeRabbit configuration file. > > Use the checkbox below for a quick retry: > - [ ] <!-- {"checkboxId": "e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> 🔍 Trigger review <!-- end of auto-generated comment: skip review by coderabbit.ai --> <!-- tips_start --> --- > [!NOTE] > <details> > <summary>🎁 Summarized by CodeRabbit Free</summary> > > Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting <https://app.coderabbit.ai/login>. > > </details> <sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub> <!-- tips_end -->
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2026-05-03 19:29:14 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull request overview

Adds initial web-layer test coverage for the film title search endpoint in the FilmController, validating the JSON response when a match is found and the current behavior when no match exists.

Changes:

  • Introduces FilmControllerSearchTest using Spring MockMvc standalone setup.
  • Tests /api/films/search?title=... for both “found” and “not found” scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## Pull request overview Adds initial web-layer test coverage for the film title search endpoint in the `FilmController`, validating the JSON response when a match is found and the current behavior when no match exists. **Changes:** - Introduces `FilmControllerSearchTest` using Spring `MockMvc` standalone setup. - Tests `/api/films/search?title=...` for both “found” and “not found” scenarios. --- 💡 <a href="/devitq/movienight-backend/new/main?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
@@ -0,0 +59,4 @@
}
@Test
fun `search returns empty body when title is missing`() {
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-05-03 19:29:14 +00:00

The test name says "title is missing", but the request still includes a title query param; the scenario is actually "no film found for the given title". Renaming the test (and any related wording) would make the intent clearer and avoid confusion with the separate case where the title request parameter is omitted (which should result in a 400).

The test name says "title is missing", but the request still includes a `title` query param; the scenario is actually "no film found for the given title". Renaming the test (and any related wording) would make the intent clearer and avoid confusion with the separate case where the `title` request parameter is omitted (which should result in a 400).
@@ -0,0 +67,4 @@
mockMvc
.get("/api/films/search") {
param("title", title)
}.andExpect {
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-05-03 19:29:14 +00:00

The controller method requires a title query parameter (@RequestParam title: String). Consider adding a test that calls /api/films/search without the title param and asserts a 400 Bad Request response, so request validation behavior is explicitly covered.

The controller method requires a `title` query parameter (`@RequestParam title: String`). Consider adding a test that calls `/api/films/search` without the `title` param and asserts a 400 Bad Request response, so request validation behavior is explicitly covered.
Sign in to join this conversation.