Skip to content

Update scripts, controllers, security config, templates, and tests #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

tsviz
Copy link
Contributor

@tsviz tsviz commented Apr 17, 2025

This pull request includes updates to the following files:

  1. build_and_run_app.sh: Updated script logic.
  2. AppController.java: Modified controller logic.
  3. SecurityConfig.java: Adjusted security configurations.
  4. login.html: Updated the login template.
  5. JUnit5ExampleTest12.java: Enhanced test cases.

Please review the changes and provide feedback.

@tsviz tsviz requested a review from Copilot April 17, 2025 15:47
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates several components of the application to enhance functionality and configuration. Key changes include:

  • Enhancements in the test cases to validate search feature behavior and default values.
  • Addition of a "Remember Me" checkbox in the login template with corresponding adjustments in the controller.
  • Updates to the security configuration to support remember-me functionality with a defined token validity period.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/test/java/net/codejava/JUnit5ExampleTest12.java New tests added and validation of default values for search and item details.
src/main/resources/templates/login.html Added a "Remember Me" checkbox to the login form.
src/main/java/net/codejava/SecurityConfig.java Integrated remember-me functionality with token validity configuration.
src/main/java/net/codejava/AppController.java Added handling for the "rememberMe" parameter in the login process.
Files not reviewed (1)
  • build_and_run_app.sh: Language not supported

@Test
void testMaxRecordsPerPage() {
System.out.println("Max records per page: " + maxRecordsPerPage);
assertEquals(20, maxRecordsPerPage, "Max records per page should be 20");
Copy link
Preview

Copilot AI Apr 17, 2025

Choose a reason for hiding this comment

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

The expected max records per page value (20) is used as a magic number in the test; define a constant (e.g., EXPECTED_MAX_RECORDS) to improve clarity.

Copilot uses AI. Check for mistakes.

@Test
void testDefaultItemPrice() {
System.out.println("Default item price: " + defaultItemPrice);
assertEquals(999.99, defaultItemPrice, "Default item price should be 999.99");
Copy link
Preview

Copilot AI Apr 17, 2025

Choose a reason for hiding this comment

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

The expected default item price (999.99) is directly embedded in the assertion; consider defining a constant (e.g., EXPECTED_ITEM_PRICE) to avoid using magic numbers.

Copilot uses AI. Check for mistakes.

@tsviz tsviz closed this Apr 17, 2025
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