Skip to content

Develop tests#1

Merged
eggy03 merged 28 commits into
mainfrom
develop-tests
Mar 2, 2026
Merged

Develop tests#1
eggy03 merged 28 commits into
mainfrom
develop-tests

Conversation

@eggy03
Copy link
Copy Markdown
Owner

@eggy03 eggy03 commented Mar 1, 2026

No description provided.

- Replace `@RequiredArgsConstructor` with `@NoArgsConstructor` and `@AllArgsConstructor` in entity classes.
- Provides a no-argument constructor for JPA compatibility and an all-argument constructor.

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Add `assertj-core` dependency (`3.27.7`) for fluent assertions in tests
- Create `src/test/resources/application.properties` for test-specific configurations
- Configure Quarkus dev services for PostgreSQL (`postgres:18.2-alpine`) and Redis (`redis:8.6.1-alpine`) in tests
- Set up Hibernate ORM and Flyway for test database schema management
- Explicitly set `rest-assured` dependency scope to `test`

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
…istration API

- Add comprehensive integration tests for the `AuditLogRegistration` API.
- Verify `POST`, `GET`, `PUT`, `DELETE` endpoints.
- Cover success, conflict, not found, and bad request scenarios.
- Validate input for null, malformed, and invalid parameters.

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
… registration

- add comprehensive integration tests for the `MessageLogRegistration` API
- verify `POST`, `GET`, `PUT`, and `DELETE` endpoints
- cover success, conflict, not found, and bad request scenarios

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Add `@NoArgsConstructor` and `@AllArgsConstructor` to `MessageLogContentDTO`.
- Add `@NoArgsConstructor` and `@AllArgsConstructor` to `MessageLogRegistrationDTO`.
- Add `@NoArgsConstructor` and `@AllArgsConstructor` to `AuditLogRegistrationDTO`.
- Provide explicit constructors for DTOs to improve object creation flexibility.

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Replace `jakarta.validation.constraints.NotNull` with `io.smallrye.common.constraint.NotNull`
- Align `NotNull` annotation usage with SmallRye common constraints in API services

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Abstract message operations with `MessageLogContentOperation` interface.
- Implement lock-enabled and lock-disabled versions.
- Select implementation via `message.locks.enabled` build property.
- Update controller and `application.properties` files.

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
…nt` API

- add integration tests for `MessageLogContent` API endpoints
- cover CRUD operations: create, read, update, delete
- include tests for valid requests, existing/missing resources, and invalid input

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- revert `log.info` to `log.debug` for lock acquisition and release messages which was changed temporarily to test whether the locking bean was selected correctly based on configuration.

- update comment from `delegate health` to `service health` as this was a product of a mass refactor

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- introduce `static final` constants for `messageId`, `messageContent`, and `authorId` values in `MessageLogContentTest.java`
- replace hardcoded test data with the new constants for improved readability and maintainability
- rename `saveMessage_exists_conflicts` test method to `saveMessage_alreadyExists_conflicts`
- add assertion for negative `messageId` in `saveMessage_invalid_badRequest` test

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- introduce parameterized tests for invalid DTO and path parameter validation
- consolidate multiple individual validation tests into single parameterized tests
- define constants for test data like `TEST_GUILD_ID` and `NEGATIVE_TEST_GUILD_ID`
- separate deserialization failure tests from validation failure tests

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- path/notALong would usually be checked for valid API paths, rather than a valid Long value. While conversion happens internally and exceptions are thrown, it is eventually wrapped in a NotFoundException by Quarkus, indicating that a resource path like that does not exist, meaning it checks for path validity before type validity, so it's mostly testing framework behavior at this point, which is why these tests have been removed.

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
@eggy03 eggy03 closed this Mar 1, 2026
@eggy03 eggy03 reopened this Mar 1, 2026
@eggy03 eggy03 closed this Mar 1, 2026
@eggy03 eggy03 reopened this Mar 1, 2026
eggy03 added 12 commits March 1, 2026 16:58
- update `quarkus.log.level` from `DEBUG` to `INFO` in `src/test/resources/application.properties`
- reduce verbosity in test environment logs

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Quarkus manages deploying db and redis containers during tests, which for some reason doesn't work while the tests are from within docker. It seems to require datasource, which Quarkus handles internally.

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- update `quarkus.platform.version` from `3.31.3` to `3.31.4`

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- rely on quarkus devservices for deploying test database and redis, instead of using H2 for db
- Set `quarkus.hibernate-orm.schema-management.strategy` to `validate`.
- Change `quarkus.log.level` to `INFO`.

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Remove redundant `findByIdOptional` checks before deletion
- Throw specific exceptions when delete operations fail, ensuring consistent error propagation

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- rename integration test files from `*Test.java` to `*ServiceIntegrationTest.java`

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
@eggy03 eggy03 self-assigned this Mar 2, 2026
@eggy03 eggy03 added the enhancement New feature or request label Mar 2, 2026
eggy03 added 4 commits March 2, 2026 19:20
- Rename `MessageContentException` and `GuildRegistrationException` to include "Failure" suffix.
- Update corresponding exception mappers and service/test usages.

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- relocate the "Migration Guide" section to its own top-level heading
- change migration guide admonition from `!IMPORTANT` to `!NOTE`

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- update `quarkus.platform.version` from `3.31.4` to `3.32.1`
- update project version from `1.0.0-SNAPSHOT` to `1.0.0`

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
@eggy03 eggy03 merged commit 15f6961 into main Mar 2, 2026
7 checks passed
@eggy03 eggy03 deleted the develop-tests branch March 2, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant