Added integration tests for UserController and MessageController.
Introduced an intermediate layer for services, now defined as interfaces with their implementations residing in the impl package.
Implemented a Utils class with an isNullable method for partial updates.
Added TestDataUtils to facilitate testing purposes.
Implemented PUT and PATCH methods for both UserController and MessageController.
Refactored UserRepositoryTest and MessageRepositoryTest to adopt a different approach, moving away from @DataJpaTest to ensure consistency with integration tests.
Standardized naming conventions for entities and repositories related to User and Message.
Standardized naming conventions for services related to UserService and MessageService.
Adjusted entity constraints to reflect actual behavior.
Removed redundant endpoints from MessageController, now utilizing a single PATCH or PUT endpoint.
Description
In the beginning, the focus was on implementing integration tests. However, after conducting several rounds of testing, it became evident that the existing setup, particularly concerning endpoints and other layers, would lead to complications in future maintenance and scalability. Therefore, alongside the integration test refactoring, efforts have been directed towards optimizing the project for future use.
The introduction of integration tests for both UserController and MessageController serves as a step towards ensuring robustness and reliability in handling user and message-related operations. Additionally, a more modular and maintainable architecture has been achieved by introducing an intermediate layer for services. Services are now defined as interfaces, with concrete implementations residing in the impl package, thus enhancing code clarity and facilitating future modifications.
A new utility class, Utils, has been introduced, housing a method isNullable designed to facilitate partial updates. This utility simplifies the process of handling nullable fields when updating entities. For improved testing capabilities, a dedicated TestDataUtils class has been added, providing utilities tailored for testing purposes. This includes methods for generating test data and setting up test scenarios.
Both PUT and PATCH methods have been implemented for UserController and MessageController, offering flexibility in handling resource updates. Refactoring efforts extend to test suites as well. The UserRepositoryTest and MessageRepositoryTest have been updated to adopt a more cohesive approach, moving away from the @DataJpaTest annotation to ensure alignment with integration tests.
Naming conventions have been standardized across entities, repositories, and services, enhancing code consistency and readability. Furthermore, adjustments have been made to entity constraints to accurately reflect their behavior and constraints.
Finally, redundant endpoints in MessageController have been removed, streamlining the API and reducing complexity.
Overall, these changes contribute to a more robust, maintainable, and efficient project structure, laying a solid foundation for future development and scalability. Moving forward, the focus shifts towards ensuring security measures are in place, anticipating smoother development and maintenance processes.
Related Issue(s)
Closes #7
Proposed Changes
UserController
andMessageController
.impl
package.Utils
class with anisNullable
method for partial updates.TestDataUtils
to facilitate testing purposes.PUT
andPATCH
methods for bothUserController
andMessageController
.UserRepositoryTest
andMessageRepositoryTest
to adopt a different approach, moving away from@DataJpaTest
to ensure consistency with integration tests.User
andMessage
.UserService
andMessageService
.MessageController
, now utilizing a singlePATCH
orPUT
endpoint.Description
In the beginning, the focus was on implementing integration tests. However, after conducting several rounds of testing, it became evident that the existing setup, particularly concerning endpoints and other layers, would lead to complications in future maintenance and scalability. Therefore, alongside the integration test refactoring, efforts have been directed towards optimizing the project for future use.
The introduction of integration tests for both
UserController
andMessageController
serves as a step towards ensuring robustness and reliability in handling user and message-related operations. Additionally, a more modular and maintainable architecture has been achieved by introducing an intermediate layer for services. Services are now defined as interfaces, with concrete implementations residing in theimpl
package, thus enhancing code clarity and facilitating future modifications.A new utility class,
Utils
, has been introduced, housing a methodisNullable
designed to facilitate partial updates. This utility simplifies the process of handling nullable fields when updating entities. For improved testing capabilities, a dedicatedTestDataUtils
class has been added, providing utilities tailored for testing purposes. This includes methods for generating test data and setting up test scenarios.Both
PUT
andPATCH
methods have been implemented forUserController
andMessageController
, offering flexibility in handling resource updates. Refactoring efforts extend to test suites as well. TheUserRepositoryTest
andMessageRepositoryTest
have been updated to adopt a more cohesive approach, moving away from the@DataJpaTest
annotation to ensure alignment with integration tests.Naming conventions have been standardized across entities, repositories, and services, enhancing code consistency and readability. Furthermore, adjustments have been made to entity constraints to accurately reflect their behavior and constraints.
Finally, redundant endpoints in
MessageController
have been removed, streamlining the API and reducing complexity.Overall, these changes contribute to a more robust, maintainable, and efficient project structure, laying a solid foundation for future development and scalability. Moving forward, the focus shifts towards ensuring security measures are in place, anticipating smoother development and maintenance processes.