Skip to content

Conversation

@developer-shubham101
Copy link
Owner

@developer-shubham101 developer-shubham101 commented Apr 17, 2025

Summary by CodeRabbit

  • Refactor

    • Updated all package and import paths from com.example to in.newdevpoint across the project, including documentation, configuration files, and code examples.
    • Maven project group ID and related configuration updated to match new package structure.
  • Tests

    • Added new test cases to improve coverage for user update and retrieval scenarios.
  • Documentation

    • Updated code snippets and examples to reflect the new package namespace.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 17, 2025

Walkthrough

This update standardizes the package naming convention across the entire Spring Boot Bootcamp project by changing all occurrences of the com.example and com.example.bootcamp package prefixes to in.newdevpoint and in.newdevpoint.bootcamp respectively. The change affects all Java source files, configuration files, documentation, and build scripts. Additionally, import statements and pointcut expressions in Aspect-Oriented Programming (AOP) code are updated to match the new package structure. The only functional code changes are the addition of four new test methods in the UserServiceTest class, which expand test coverage for user update and retrieval scenarios. No other logic or functionality is altered.

Changes

Files/Paths Change Summary
docs/3.1 Spring Boot REST API - Creating a REST API with Spring Boot.md, docs/4.2 Spring Boot Security - Understanding JWT Tokens.md, docs/7.1 Spring Boot Advanced - Aspect Oriented Programming AOP in Spring Boot.md, docs/7.2 Spring Boot Advanced - Actuator Confirmations Explained.md, docs/8.3 Spring Boot Hibernate - Introduction to Hibernate.md Updated all example code, configuration, and documentation references from com.example to in.newdevpoint.
pom.xml Changed Maven groupId and OpenAPI plugin package names from com.example to in.newdevpoint.
src/main/java/in/newdevpoint/bootcamp/... (all Java source files) Updated package declarations and import statements from com.example.bootcamp to in.newdevpoint.bootcamp.
src/main/java/in/newdevpoint/bootcamp/aop/LoggingAspect.java Updated AspectJ pointcut expressions and imports to use new package name.
src/test/java/in/newdevpoint/bootcamp/UserServiceTest.java Updated package/imports and added four new test methods for user update and retrieval scenarios.
src/test/java/in/newdevpoint/bootcamp/FirstProjectApplicationTests.java, src/test/java/in/newdevpoint/bootcamp/UserUseCaseTest.java Updated package declarations and imports to reflect new package structure.

Sequence Diagram(s)

sequenceDiagram
    participant Test as UserServiceTest
    participant Service as UserService
    participant Repo as UserRepository

    Test->>Service: updateUser(userId, userReq)
    alt User exists
        Service->>Repo: findById(userId)
        Repo-->>Service: Optional<UserEntity>
        Service->>Repo: save(updatedUser)
        Repo-->>Service: UserEntity
        Service-->>Test: updated UserEntity
    else User does not exist
        Service->>Repo: findById(userId)
        Repo-->>Service: Optional.empty
        Service-->>Test: throws UserNotFoundException
    end
Loading

Poem

In fields of code where packages roam,
From com.example we’ve found a new home.
Now in.newdevpoint hops through every class,
A tidy warren where all bunnies pass.
With extra tests to keep us spry,
Our code now leaps both far and high!
🐇✨

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a818ca and aed49f5.

📒 Files selected for processing (56)
  • spring-boot-bootcamp/docs/3. Spring Boot REST API/3.1 Spring Boot REST API - Creating a REST API with Spring Boot.md (5 hunks)
  • spring-boot-bootcamp/docs/4. Spring Boot Security/4.2 Spring Boot Security - Understanding JWT Tokens.md (6 hunks)
  • spring-boot-bootcamp/docs/7. Spring Boot Advanced/7.1 Spring Boot Advanced - Aspect Oriented Programming AOP in Spring Boot.md (8 hunks)
  • spring-boot-bootcamp/docs/7. Spring Boot Advanced/7.2 Spring Boot Advanced - Actuator Confirmations Explained.md (1 hunks)
  • spring-boot-bootcamp/docs/8. Spring Boot Hibernate/8.3 Spring Boot Hibernate - Introduction to Hibernate.md (1 hunks)
  • spring-boot-bootcamp/pom.xml (2 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/SBBootCampApplication.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/aop/LoggingAspect.java (3 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/config/ApplicationShutdown.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/config/CorsConfiguration.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/config/RestTemplateConfig.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/config/SwaggerBearerConfig.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/controller/AdminController.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/controller/AuthController.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/controller/SystemController.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/controller/UserV1Controller.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/data/SampleData.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/CoffeeEntity.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/ERole.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/ErrorResponse.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/ExceptionLog.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/Role.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/User.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/UserEntity.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/exceptions/GlobalExceptionHandler.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/exceptions/UserAlreadyExistsException.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/exceptions/UserNotFoundException.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/mapper/UserMapper.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/payload/request/LoginRequest.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/payload/request/SignupRequest.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/payload/response/JwtResponse.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/payload/response/MessageResponse.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/repository/ExceptionLogRepository.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/repository/RoleRepository.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/repository/UserRepository.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/scheduler/MyScheduledTask.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/security/WebSecurityConfig.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/security/jwt/AuthEntryPointJwt.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/security/jwt/AuthTokenFilter.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/security/jwt/JwtUtils.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/security/services/UserDetailsImpl.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/security/services/UserDetailsServiceImpl.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/service/UserService.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/usecase/OrderService.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/usecase/SystemService.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/usecase/UserUseCase.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/utility/BigONotation.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/utility/FileUtility.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/utility/RoleConstants.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/utility/Utility.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/validators/EmailValidator.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/validators/ValidEmail.java (1 hunks)
  • spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/validators/ValidationExceptionHandler.java (1 hunks)
  • spring-boot-bootcamp/src/test/java/in/newdevpoint/bootcamp/FirstProjectApplicationTests.java (1 hunks)
  • spring-boot-bootcamp/src/test/java/in/newdevpoint/bootcamp/UserServiceTest.java (2 hunks)
  • spring-boot-bootcamp/src/test/java/in/newdevpoint/bootcamp/UserUseCaseTest.java (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (8)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/controller/AuthController.java (2)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/payload/response/JwtResponse.java (1)
  • JwtResponse (5-65)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/payload/response/MessageResponse.java (1)
  • MessageResponse (3-17)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/usecase/SystemService.java (1)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/utility/Utility.java (1)
  • Utility (10-23)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/controller/SystemController.java (1)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/data/SampleData.java (1)
  • SampleData (6-30)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/controller/UserV1Controller.java (1)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/utility/RoleConstants.java (1)
  • RoleConstants (3-6)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/service/UserService.java (1)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/utility/FileUtility.java (1)
  • FileUtility (6-35)
spring-boot-bootcamp/src/test/java/in/newdevpoint/bootcamp/UserUseCaseTest.java (1)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/exceptions/UserNotFoundException.java (1)
  • UserNotFoundException (3-7)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/usecase/UserUseCase.java (1)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/exceptions/UserNotFoundException.java (1)
  • UserNotFoundException (3-7)
spring-boot-bootcamp/src/test/java/in/newdevpoint/bootcamp/UserServiceTest.java (1)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/exceptions/UserNotFoundException.java (1)
  • UserNotFoundException (3-7)
🪛 LanguageTool
spring-boot-bootcamp/docs/7. Spring Boot Advanced/7.1 Spring Boot Advanced - Aspect Oriented Programming AOP in Spring Boot.md

[typographical] ~76-~76: Two consecutive dots
Context: ...od completes. - The pointcut expression execution(* in.newdevpoint.service.*.*(..)) means that this advice applies to al...

(DOUBLE_PUNCTUATION)

🔇 Additional comments (93)
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/data/SampleData.java (1)

1-1: Package declaration renamed correctly
The package statement has been updated to in.newdevpoint.bootcamp.data, and the file path aligns with the new namespace. No further modifications are needed here.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/Role.java (1)

1-1: Package declaration renamed correctly
The package statement has been updated to in.newdevpoint.bootcamp.entity, matching the directory structure and the updated project namespace.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/SBBootCampApplication.java (1)

1-1: Package declaration renamed correctly
The main application class has its package updated to in.newdevpoint.bootcamp. Ensure that your build configuration (e.g., Maven <groupId>) and any explicit component-scan settings reflect this change.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/utility/BigONotation.java (1)

1-1: Package declaration renamed correctly
Updated to in.newdevpoint.bootcamp.utility, which corresponds to the file’s location and the new namespace convention. No further action required.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/usecase/OrderService.java (1)

1-1: Package declaration renamed correctly
The service class package is now in.newdevpoint.bootcamp.usecase, consistent with the directory structure. Verify that your Spring configuration will pick up beans in this package.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/utility/RoleConstants.java (1)

1-1: Package namespace correctly updated
The package declaration has been updated from com.example.bootcamp.utility to in.newdevpoint.bootcamp.utility, matching the new project structure. No lingering references to the old namespace are present.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/config/CorsConfiguration.java (1)

1-1: Consistent package declaration
The file now declares package in.newdevpoint.bootcamp.config, replacing the previous com.example.bootcamp.config. All imports are aligned and no outdated namespace remains.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/scheduler/MyScheduledTask.java (1)

1-1: Package declaration aligned with new namespace
Updated to in.newdevpoint.bootcamp.scheduler. The rest of the class and its imports remain unchanged and correctly reference third‑party and JDK packages.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/config/ApplicationShutdown.java (1)

1-1: Package declaration updated
Now uses in.newdevpoint.bootcamp.config, replacing the old com.example prefix. No residual imports or references to the deprecated namespace are detected.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/config/SwaggerBearerConfig.java (1)

1-1: Package namespace updated successfully
The package declaration is now in.newdevpoint.bootcamp.config. All imports and annotations remain valid under the new namespace.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/validators/ValidEmail.java (1)

1-1:

Details

✅ Verification successful

Package declaration updated correctly
The ValidEmail annotation’s package has been renamed to in.newdevpoint.bootcamp.validators, aligning with the project-wide namespace change.

To ensure no stale references to the old com.example.bootcamp.validators remain, you can run:


🏁 Script executed:

#!/bin/bash
grep -R "com\.example\.bootcamp.validators" -n .

Length of output: 50


No stale references found – package declaration is correct
All occurrences of com.example.bootcamp.validators have been removed, and the ValidEmail annotation now correctly resides in in.newdevpoint.bootcamp.validators. Changes are approved.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/config/RestTemplateConfig.java (1)

1-1:

Details

✅ Verification successful

Package declaration aligned with new namespace
The package has been updated to in.newdevpoint.bootcamp.config, consistent with the renaming convention.

Verify there are no remaining imports of the old com.example.bootcamp.config:


🏁 Script executed:

grep -R "com\.example\.bootcamp.config" -n .

Length of output: 46


Package rename verified
No occurrences of the old com.example.bootcamp.config were found in the codebase. The package declaration in spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/config/RestTemplateConfig.java is correctly set to:

package in.newdevpoint.bootcamp.config;
spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/exceptions/UserNotFoundException.java (1)

1-1:

Details

✅ Verification successful

Exception package updated
The UserNotFoundException class now resides in in.newdevpoint.bootcamp.exceptions, matching the project-wide refactor.

Ensure no leftover references to com.example.bootcamp.exceptions:


🏁 Script executed:

grep -R "com\.example\.bootcamp.exceptions" -n .

Length of output: 50


🏁 Script executed:

#!/bin/bash
# Verify there are no leftover references to the old package
grep -R "com\\.example\\.bootcamp" -n .

Length of output: 39


Exception package updated – no leftover references
The UserNotFoundException class now resides in in.newdevpoint.bootcamp.exceptions, matching the project-wide refactor. I’ve verified that no occurrences of com.example.bootcamp remain in the codebase.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/exceptions/UserAlreadyExistsException.java (1)

1-1:

Details

✅ Verification successful

Exception package updated
The UserAlreadyExistsException class’s package has been renamed to in.newdevpoint.bootcamp.exceptions, adhering to the new package structure.

Validate that no part of the code still references the old namespace:


🏁 Script executed:

grep -R "com\.example\.bootcamp.exceptions" -n .

Length of output: 50


No remaining old namespace references detected
Search for com.example.bootcamp.exceptions returned no matches, confirming the old package isn’t referenced anywhere.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/controller/UserV1Controller.java (1)

1-6:

Details

✅ Verification successful

Controller package and imports updated
The package declaration and key imports (UsersApi, UserReq, UserUseCase, RoleConstants) have been updated to the in.newdevpoint.bootcamp namespace, preserving consistency across controllers.

Run a global search to catch any missed com.example.bootcamp references:


🏁 Script executed:

grep -R "com\.example\.bootcamp" -n .

Length of output: 39


Approval: Namespace update confirmed
A global search for com.example.bootcamp returned no matches. The package declaration and imports are consistently updated to in.newdevpoint.bootcamp.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/payload/response/MessageResponse.java (1)

1-1: Namespace update on MessageResponse: The package declaration has been updated to in.newdevpoint.bootcamp.payload.response, aligning perfectly with the project-wide refactoring from the com.example namespace.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/controller/AdminController.java (1)

1-3: Namespace and import alignment in AdminController: The package declaration and the BigONotation import have been updated to the new in.newdevpoint.bootcamp namespace, ensuring consistency with the refactoring.

spring-boot-bootcamp/pom.xml (2)

11-11: Project groupId updated: The <groupId> has been correctly changed to in.newdevpoint, reflecting the new base package in the Maven coordinates.


200-202: OpenAPI generator plugin namespaces updated: The <packageName>, <apiPackage>, and <modelPackage> entries have been updated to in.newdevpoint.bootcamp and its subpackages, matching the renamed package hierarchy for generated sources.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/controller/AuthController.java (1)

1-14: AuthController namespace and imports updated: The package declaration and all imports for entities, requests, responses, repositories, and security components have been shifted to in.newdevpoint.bootcamp. No stale com.example references remain, maintaining a uniform package structure.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/UserEntity.java (1)

1-1: Namespace update on UserEntity: The package declaration has been updated to in.newdevpoint.bootcamp.entity, in line with the global renaming effort.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/User.java (2)

1-1: Package declaration updated to the new namespace.

The package has been correctly refactored from com.example.bootcamp.entity to in.newdevpoint.bootcamp.entity. All imports in this file refer to external libraries, and there are no remaining references to the old package.


1-1:

Details

✅ Verification successful

Verify no residual references to the old com.example.bootcamp package.

Please ensure that no stray occurrences of the old package prefix remain elsewhere in the codebase (e.g., in AOP pointcuts, XML/YAML configs, templates). You can run:

Expect zero matches.


🏁 Script executed:

#!/bin/bash
# Verify no leftover references to the old package prefix
rg -n "com\\.example\\.bootcamp"

Length of output: 32


No residual com.example.bootcamp references detected
Ran rg -n 'com\.example\.bootcamp' across the codebase and found zero occurrences. All clear.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/utility/Utility.java (1)

1-1: Package declaration updated correctly.

The package was refactored from com.example.bootcamp.utility to in.newdevpoint.bootcamp.utility. No business logic or API changes were introduced.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/CoffeeEntity.java (1)

1-1: Package namespace updated.

Refactored the package to in.newdevpoint.bootcamp.entity. The class structure and Lombok @Data usage remain valid.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/utility/FileUtility.java (1)

1-1: Package declaration refactored.

Changed the package to in.newdevpoint.bootcamp.utility. The file upload logic and imports are unaffected.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/ERole.java (1)

1-1: Package declaration updated.

The enum package has been updated to in.newdevpoint.bootcamp.entity. No changes to the enum values.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/ExceptionLog.java (1)

1-1: Package declaration updated
The package has been correctly renamed from com.example.bootcamp.entity to in.newdevpoint.bootcamp.entity in line with the new organizational domain.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/entity/ErrorResponse.java (1)

1-1: Package declaration updated
The package has been consistently updated to in.newdevpoint.bootcamp.entity, aligning with the project-wide namespace change.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/validators/EmailValidator.java (1)

1-1: Package declaration updated
Renamed the package to in.newdevpoint.bootcamp.validators, matching the new reverse-domain convention across the codebase.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/security/jwt/AuthEntryPointJwt.java (1)

1-1: Package declaration updated
Updated the package to in.newdevpoint.bootcamp.security.jwt to reflect the new namespace structure.

spring-boot-bootcamp/src/test/java/in/newdevpoint/bootcamp/FirstProjectApplicationTests.java (1)

1-1: Package declaration updated
The test package has been renamed to in.newdevpoint.bootcamp in accordance with the domain-level refactoring.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/payload/request/LoginRequest.java (1)

1-1: Package declaration updated to reflect new namespace
The package has been correctly renamed to in.newdevpoint.bootcamp.payload.request and matches the directory structure.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/validators/ValidationExceptionHandler.java (1)

1-1: Package declaration updated to new namespace
Renaming the package to in.newdevpoint.bootcamp.validators aligns with the PR objective and maintains consistency across validator classes.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/payload/response/JwtResponse.java (1)

1-1: Package declaration updated to new namespace
The package has been correctly changed to in.newdevpoint.bootcamp.payload.response, ensuring alignment with the refactored project structure.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/security/jwt/JwtUtils.java (1)

1-1: Package declaration updated to new namespace
The package has been updated to in.newdevpoint.bootcamp.security.jwt, matching the directory and overall renaming strategy.

spring-boot-bootcamp/docs/8. Spring Boot Hibernate/8.3 Spring Boot Hibernate - Introduction to Hibernate.md (1)

110-110: Hibernate mapping class updated to new package
The <mapping> element now references in.newdevpoint.models.User, consistent with the namespace refactoring across entities.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/mapper/UserMapper.java (1)

1-4: Package and imports updated to in.newdevpoint.bootcamp
The package declaration and imports were correctly refactored from com.example.bootcamp to in.newdevpoint.bootcamp. No missing or leftover references detected.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/usecase/UserUseCase.java (1)

1-7: Package and imports updated for UserUseCase
The package and import statements have been consistently updated to in.newdevpoint.bootcamp.usecase and its dependent namespaces (dto, entity, exceptions, mapper, service). All references align with the new base package.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/security/jwt/AuthTokenFilter.java (1)

1-4: Package and import updated for AuthTokenFilter
The package declaration and the import for UserDetailsServiceImpl now target in.newdevpoint.bootcamp.security.*. Confirm that all JWT-related classes (JwtUtils, AuthEntryPointJwt, etc.) are present under the new package without leftover com.example references.

spring-boot-bootcamp/src/test/java/in/newdevpoint/bootcamp/UserUseCaseTest.java (2)

1-1: Test package declaration updated
The test class now uses the in.newdevpoint.bootcamp package.


6-11: Test imports updated
Imports for UserReq, UserEntity, UserNotFoundException, UserMapper, UserService, and UserUseCase have been refactored to the new namespace. All appear correct and consistent.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/exceptions/GlobalExceptionHandler.java (1)

1-3: Package and import for GlobalExceptionHandler updated
The handler is now under in.newdevpoint.bootcamp.exceptions, and the import for ErrorResponse reflects the new entity package. Ensure UserNotFoundException and UserAlreadyExistsException remain accessible in the same package scope.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/security/services/UserDetailsImpl.java (2)

1-1: Package declaration updated
The package was correctly updated to in.newdevpoint.bootcamp.security.services to match the new project namespace and file path.


4-4: Import statement updated for UserEntity
The import for UserEntity was changed from the old namespace to in.newdevpoint.bootcamp.entity.UserEntity, aligning with the relocated entity package.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/repository/UserRepository.java (2)

1-1: Package declaration updated
Updated the package to in.newdevpoint.bootcamp.repository, matching the new base package structure and directory layout.


3-3: Import statement updated for UserEntity
Switched the UserEntity import to in.newdevpoint.bootcamp.entity.UserEntity in line with the new package naming.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/usecase/SystemService.java (3)

1-1: Package declaration updated
Changed the package to in.newdevpoint.bootcamp.usecase to reflect the global renaming of the project’s root package.


3-3: Import updated for CoffeeEntity
The import for CoffeeEntity was updated to in.newdevpoint.bootcamp.entity.CoffeeEntity, matching its relocated package.


4-4: Import updated for Utility
Updated the Utility import to in.newdevpoint.bootcamp.utility.Utility, aligning with the new package hierarchy.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/security/services/UserDetailsServiceImpl.java (3)

1-1: Package declaration updated
The package declaration now reads in.newdevpoint.bootcamp.security.services, consistent with the file’s path under the new namespace.


3-3: Import updated for UserEntity
Changed the import of UserEntity to the new location: in.newdevpoint.bootcamp.entity.UserEntity.


4-4: Import updated for UserRepository
Updated to import in.newdevpoint.bootcamp.repository.UserRepository, reflecting the renamed repository package.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/controller/SystemController.java (4)

1-1: Package declaration updated
Revised to in.newdevpoint.bootcamp.controller in accordance with the new base package naming.


3-3: Import updated for SampleData
Adjusted import to in.newdevpoint.bootcamp.data.SampleData, matching its new package location.


4-4: Import updated for OrderService
Switched to import in.newdevpoint.bootcamp.usecase.OrderService, reflecting the new package structure.


5-5: Import updated for SystemService
Changed import to in.newdevpoint.bootcamp.usecase.SystemService to align with the renamed usecase package.

spring-boot-bootcamp/docs/7. Spring Boot Advanced/7.2 Spring Boot Advanced - Actuator Confirmations Explained.md (1)

131-131: Updated loggers endpoint package in curl example
The curl command now correctly references the new base package in.newdevpoint instead of com.example.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/payload/request/SignupRequest.java (2)

1-1: Updated package declaration to new namespace
The package has been renamed from com.example.bootcamp.payload.request to in.newdevpoint.bootcamp.payload.request, aligning with the project-wide refactoring.


3-3: Adjusted import for ValidEmail validator
The import path has been updated to in.newdevpoint.bootcamp.validators.ValidEmail to match the new package structure.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/repository/RoleRepository.java (2)

1-1: Updated package declaration to new namespace
The repository package is correctly changed to in.newdevpoint.bootcamp.repository.


3-4: Corrected entity imports for new package
Imports for ERole and Role now reference in.newdevpoint.bootcamp.entity, ensuring consistency.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/security/WebSecurityConfig.java (2)

1-1: Updated package declaration to new namespace
The security configuration package has been renamed to in.newdevpoint.bootcamp.security per the global refactoring.


3-5: Updated security-related imports to new package
Imports for AuthEntryPointJwt, AuthTokenFilter, and UserDetailsServiceImpl now align with the in.newdevpoint.bootcamp.security namespace.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/service/UserService.java (2)

1-1: Updated package declaration to new namespace
The service package is correctly updated to in.newdevpoint.bootcamp.service.


7-11: Adjusted project-specific imports to new package
Imports for UserReq, UserEntity, UserMapper, UserRepository, and FileUtility have been updated to in.newdevpoint.bootcamp.*, maintaining consistency across the codebase.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/repository/ExceptionLogRepository.java (1)

1-3: Package namespace update looks good.

The package declaration and import statement have been correctly updated to reflect the new namespace structure (in.newdevpoint.bootcamp instead of com.example.bootcamp).

spring-boot-bootcamp/docs/4. Spring Boot Security/4.2 Spring Boot Security - Understanding JWT Tokens.md (6)

57-57: Package namespace updated correctly.

The package declaration has been properly updated from com.example.demo to in.newdevpoint.demo.


100-102: Import statements and package declaration updated consistently.

Package and import statements have been properly updated to use the new namespace.


119-119: JwtUtil package updated correctly.

The package declaration for the JwtUtil class has been properly updated.


175-177: JwtRequestFilter package and imports updated correctly.

The package declaration and imports have been properly updated to use the new namespace.


231-233: SecurityConfig package and imports updated correctly.

The package declaration and imports have been properly updated to use the new namespace.


273-277: AuthenticationController package and imports updated correctly.

All package declarations and import statements have been properly updated to use the new namespace.

spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/aop/LoggingAspect.java (5)

1-3: Package and import statements updated correctly.

The package declaration and import statement have been properly updated to use the new namespace.


16-16: Pointcut expression updated correctly.

The AspectJ pointcut expression has been updated to target the new package structure.


29-30: UserService pointcut expression updated correctly.

The @before advice pointcut expression has been properly updated to reference the new package path.


34-35: @after advice pointcut expression updated correctly.

The pointcut expression for the @after advice has been updated to use the new package structure.


39-39: Commented @AfterThrowing pointcut updated correctly.

Even though this is commented code, the pointcut expression has been properly updated to reflect the new package structure.

spring-boot-bootcamp/src/test/java/in/newdevpoint/bootcamp/UserServiceTest.java (5)

1-10: Package and import statements updated correctly.

All package declarations and import statements have been properly updated to use the new namespace structure.


80-95: Good addition of test for user update functionality.

The new test correctly verifies that the user update functionality works when the user exists. It:

  1. Sets up a mock existing user
  2. Configures mock repository behavior
  3. Calls the service method
  4. Verifies the result contains the updated information

This helps improve test coverage for the update functionality.


97-104: Good test for user update with non-existent user.

This test properly verifies that attempting to update a non-existent user throws a UserNotFoundException. The test correctly:

  1. Sets up the test data
  2. Mocks the repository to return an empty Optional
  3. Asserts that the expected exception is thrown

This is a good test case for the negative scenario.


106-118: Well-implemented test for getAllUsers with non-empty list.

This test thoroughly verifies the getAllUsers functionality when users exist in the database:

  1. Sets up mock data with two users
  2. Mocks the repository behavior
  3. Calls the service method
  4. Verifies the result contains the expected data with multiple assertions

Good job checking both the list size and the actual user data.


120-128: Good edge case testing for empty user list.

This test properly verifies the behavior of getAllUsers when the repository returns an empty list. It correctly:

  1. Mocks the repository to return an empty list
  2. Verifies that the result is not null
  3. Checks that the returned list is empty

Testing this edge case is valuable for ensuring robust code behavior.

spring-boot-bootcamp/docs/3. Spring Boot REST API/3.1 Spring Boot REST API - Creating a REST API with Spring Boot.md (5)

58-58: Consistent package declaration for User model
The package in.newdevpoint.demo.model; update correctly reflects the new namespace.


112-114: Updated package and import for UserRepository
Changing to package in.newdevpoint.demo.repository; and importing in.newdevpoint.demo.model.User aligns with the renamed package structure.


128-131: Updated package and imports for UserService
The declarations package in.newdevpoint.demo.service;, import in.newdevpoint.demo.model.User;, and import in.newdevpoint.demo.repository.UserRepository; are correctly renamed.


175-178: Updated package and imports for UserController
Switching to package in.newdevpoint.demo.controller; along with import in.newdevpoint.demo.model.User; and import in.newdevpoint.demo.service.UserService; is accurate.


271-271: Updated package declaration for DemoApplication
The main application class now correctly uses package in.newdevpoint.demo;.

spring-boot-bootcamp/docs/7. Spring Boot Advanced/7.1 Spring Boot Advanced - Aspect Oriented Programming AOP in Spring Boot.md (5)

57-57: Approve updated pointcut in Around advice example
The pointcut expression execution(* in.newdevpoint.service.*.*(..)) is correctly updated to the new package.


76-76: Approve updated documentation text for pointcut explanation
The description referencing in.newdevpoint.service now matches the renamed package.

🧰 Tools
🪛 LanguageTool

[typographical] ~76-~76: Two consecutive dots
Context: ...od completes. - The pointcut expression execution(* in.newdevpoint.service.*.*(..)) means that this advice applies to al...

(DOUBLE_PUNCTUATION)


82-82: Approve updated package declaration for LoggingAspect target service
Changing to package in.newdevpoint.service; aligns with the new namespace.


100-102: Approve updated package and import in AopExampleApplication
Switching to package in.newdevpoint; and importing in.newdevpoint.service.MyService is correct.


134-134: Approve updated AOP advice annotations
All advice annotations (@Before, @After, @AfterReturning, @AfterThrowing, and the second @Around) have their pointcuts correctly renamed to in.newdevpoint.service.MyService.performTask(..).

Also applies to: 143-143, 152-152, 161-161, 170-170

✨ Finishing Touches
  • 📝 Docstrings were successfully generated. (🔄 Check again to generate docstrings again)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai bot added a commit that referenced this pull request Apr 17, 2025
Docstrings generation was requested by @developer-shubham101.

* #3 (comment)

The following files were modified:

* `spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/aop/LoggingAspect.java`
* `spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/exceptions/UserAlreadyExistsException.java`
* `spring-boot-bootcamp/src/main/java/in/newdevpoint/bootcamp/exceptions/UserNotFoundException.java`
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 17, 2025

Note

Generated docstrings for this pull request at #4

@developer-shubham101 developer-shubham101 merged commit f3cec40 into main Apr 19, 2025
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.

2 participants