Skip to content

Simple integration test#136

Open
Patseroni wants to merge 5 commits intomainfrom
integration-test/115
Open

Simple integration test#136
Patseroni wants to merge 5 commits intomainfrom
integration-test/115

Conversation

@Patseroni
Copy link

@Patseroni Patseroni commented Feb 5, 2026

Adds a simple integration test for the health endpoint that verifies the endpoint returns 'OK' and that the status is correctly persisted and retrievable from the H2 database.

Summary by CodeRabbit

  • New Features

    • Added a health check endpoint (GET /health) that returns "OK".
  • Improvements

    • Extended report retention to 30 days in the development profile.
  • Tests

    • Added an integration test validating the health endpoint and persistence.
    • Adjusted test suite: consolidated test dependencies and removed/disabled some legacy tests.
  • Chores

    • Added runtime H2 database support and updated testing-related dependency configuration.

@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

Walkthrough

Adds a health-check endpoint and persistence for its status, introduces an H2 test configuration, adjusts Maven test/build dependencies, and adds an integration test while removing or commenting out one existing authentication test.

Changes

Cohort / File(s) Summary
Health Check Feature
backend/src/main/java/org/fungover/zipp/controller/HealthController.java, backend/src/main/java/org/fungover/zipp/entity/HealthEntity.java, backend/src/main/java/org/fungover/zipp/repository/HealthRepository.java
New GET /health REST endpoint returning "OK", new HealthEntity JPA entity, and HealthRepository Spring Data JPA interface for persistence.
Integration Tests & Test config
backend/src/test/java/org/fungover/zipp/integration/HealthIntegrationTest.java, backend/src/test/resources/application-test.yml, backend/src/test/java/org/fungover/zipp/authtest/AuthenticationIntegrationTest.java
Adds HealthIntegrationTest that exercises controller and repository with H2; adds application-test.yml to disable Kafka and configure in-memory H2; AuthenticationIntegrationTest was fully commented out (no longer active).
Build / Dependencies
backend/pom.xml
Added runtime H2 dependency; replaced/adjusted test dependencies (switched to spring-boot-test v4.0.0, removed duplicate/test dependency blocks and some plugin deps like pitest-junit5-plugin and inline Checkstyle artifact).
Configurations & Formatting
backend/src/main/resources/application-dev.yml, backend/src/main/resources/application-test.yml, backend/src/main/resources/application.properties, backend/src/test/java/org/fungover/zipp/TestcontainersConfiguration.java
Increased report.delete-expired-after-days from 1 to 30 in dev; fixed YAML indentation and minor formatting (blank line, trailing newline) in various config/test files.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client
    participant Controller as HealthController
    participant Repo as HealthRepository
    participant DB as H2 (test DB)

    Client->>Controller: GET /health
    Controller-->>Client: "OK"
    Controller->>Repo: save(new HealthEntity("OK"))
    Repo->>DB: INSERT health_entity(status="OK")
    DB-->>Repo: persisted entity (id)
    Repo-->>Controller: saved entity (id,status)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

ready for review

Suggested reviewers

  • Tobias-hubs
  • Emilyempa
  • kappsegla
  • viktornoskire
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch integration-test/115

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🤖 Fix all issues with AI agents
In `@backend/pom.xml`:
- Around line 30-35: The dependencyManagement entry and actual dependency for
lz4 disagree: dependencyManagement declares groupId "org.lz4" with
lz4-java:1.8.1 while the dependency uses groupId "at.yawk.lz4" (version 1.10.1);
update them to match or remove the unused management entry. Fix by making the
groupId/artifactId/version consistent between the dependencyManagement section
and the dependency declaration (either change dependencyManagement to
at.yawk.lz4:lz4-java:1.10.1, or change the dependency to
org.lz4:lz4-java:1.8.1), and repeat the same alignment for the second occurrence
referenced in the comment.
- Around line 188-191: Remove the duplicate Spring Boot web starter dependency:
delete the <dependency> element whose <groupId> is org.springframework.boot and
<artifactId> is spring-boot-starter-web, leaving the existing
spring-boot-starter-webmvc dependency in place (artifactId
spring-boot-starter-webmvc) so only the webmvc starter is declared.

In `@backend/src/main/java/org/fungover/zipp/controller/HealthController.java`:
- Around line 1-13: The file HealthController (class HealthController, method
health()) has Spotless formatting violations; run the formatter to fix them by
executing mvn spotless:apply and then commit the resulting changes (or apply
your IDE's Spotless/format settings) so the HealthController.java formatting
matches the project's Spotless rules and CI passes.

In `@backend/src/test/java/org/fungover/zipp/BackendApplicationTests.java`:
- Around line 1-14: Remove the entirely commented-out test class
BackendApplicationTests (the file containing the commented package/imports and
the BackendApplicationTests class) from the repository; since ContextLoadsTest
already covers context loading, delete this file to eliminate the commented code
and resolve Spotless formatting violations rather than leaving the
BackendApplicationTests.java with commented content.

In `@backend/src/test/java/org/fungover/zipp/ContextLoadsTest.java`:
- Around line 1-17: The file ContextLoadsTest (class ContextLoadsTest, method
contextLoads) has Spotless formatting violations; run the formatter (mvn
spotless:apply) to reformat this test file and commit the changes so imports,
spacing, and header comments comply with Spotless rules (or manually adjust
formatting to match the project's Spotless configuration if you prefer), then
re-run the build to confirm the CI formatting error is resolved.
- Around line 9-11: Four test classes load the "test" profile but only
ContextLoadsTest has `@EmbeddedKafka`, causing ${spring.embedded.kafka.brokers} to
be unresolved in others; fix by either (A) adding `@EmbeddedKafka`(partitions = 1,
topics = {"test-topic"}) to HealthIntegrationTest,
AuthenticationIntegrationTest, and BackendApplicationTests (so the embedded
broker exists when Spring resolves spring.embedded.kafka.brokers) or (B) update
application-test.yml to give spring.embedded.kafka.brokers a safe default (e.g.,
spring.embedded.kafka.brokers: ${SPRING_EMBEDDED_KAFKA_BROKERS:} or a
blank/default value) so tests without the EmbeddedKafka annotation can start;
choose one approach and apply it consistently to all classes (ContextLoadsTest,
HealthIntegrationTest, AuthenticationIntegrationTest, BackendApplicationTests).

In
`@backend/src/test/java/org/fungover/zipp/integration/HealthIntegrationTest.java`:
- Around line 24-27: The file HealthIntegrationTest has Spotless formatting
violations due to trailing blank lines at the end of the file; open the
HealthIntegrationTest class file, remove extra blank lines so the file ends with
a single newline, and then run mvn spotless:apply (or your IDE's Spotless
formatter) to reformat and update the file to satisfy Spotless checks.
🧹 Nitpick comments (8)
backend/src/test/java/org/fungover/zipp/TestBackendApplication.java (1)

1-10: Remove or restore commented-out code.

Fully commented-out files create technical debt. If Testcontainers-based testing is being replaced with @EmbeddedKafka, delete this file. If the intent is to restore it later, consider tracking this in an issue instead.

backend/src/test/java/org/fungover/zipp/ContextLoadsTest.java (1)

8-8: Remove informal comment.

The comment "This is just a test-file. Allowed to be removed." is unclear and unprofessional. Either remove the comment or replace it with a proper Javadoc explaining the test's purpose (e.g., "Verifies Spring Boot application context loads successfully under test profile.").

backend/src/main/java/org/fungover/zipp/controller/HealthController.java (1)

6-13: Consider using Spring Boot Actuator instead.

Spring Boot Actuator provides a built-in /actuator/health endpoint with standardized response format, health indicators, and configurable security. If this custom endpoint is purely for integration testing sanity checks, it's fine, but if you need health checks in production, Actuator is the idiomatic approach.

backend/src/test/java/org/fungover/zipp/authtest/AuthenticationIntegrationTest.java (1)

1-66: Commenting out authentication integration tests reduces security test coverage.

This file previously validated critical authentication flows including redirect behavior for unauthenticated users, public endpoint access, and OAuth2 user login verification. While the PR description mentions configuration issues with MockMvc, completely disabling these tests creates a gap in security testing.

Consider creating a tracking issue to restore these tests once the configuration issues are resolved, rather than leaving commented code indefinitely.

Would you like me to open an issue to track restoring these authentication integration tests?

backend/src/test/java/org/fungover/zipp/integration/HealthIntegrationTest.java (1)

11-23: Consider adding @EmbeddedKafka for test context consistency.

The ContextLoadsTest in the same test profile uses @EmbeddedKafka(partitions = 1, topics = {"test-topic"}). If the application context requires Kafka, this test may fail without it. Consider adding the same annotation for consistency:

 `@SpringBootTest`
 `@ActiveProfiles`("test")
+@EmbeddedKafka(partitions = 1, topics = {"test-topic"})
 class HealthIntegrationTest {

Also note that this test calls the controller method directly rather than testing through HTTP. While valid for verifying bean wiring, it doesn't cover the actual /health endpoint routing and response serialization.

backend/src/test/java/org/fungover/zipp/TestcontainersConfiguration.java (1)

1-18: Commented-out Testcontainers configuration creates inconsistency with pom.xml.

This configuration is disabled, but pom.xml still declares testcontainers-bom and testcontainers:kafka dependencies. Consider either:

  1. Removing the Testcontainers dependencies from pom.xml if not needed
  2. Deleting this file entirely instead of leaving commented code

Additionally, the CI pipeline reports Spotless formatting violations for this file. Run mvn spotless:apply to fix.

backend/pom.xml (2)

37-44: Testcontainers BOM imported but Testcontainers configuration is disabled.

The testcontainers-bom is imported and testcontainers:kafka is declared as a test dependency, but TestcontainersConfiguration.java is fully commented out. If Testcontainers aren't being used, consider removing these dependencies to reduce build complexity:

-      <!-- Testcontainers BOM -->
-      <dependency>
-        <groupId>org.testcontainers</groupId>
-        <artifactId>testcontainers-bom</artifactId>
-        <version>1.19.7</version>
-        <type>pom</type>
-        <scope>import</scope>
-      </dependency>

And remove the Kafka testcontainers dependency if unused.

Also applies to: 152-156


207-246: Removal of PMD, JaCoCo, and PIT plugins reduces code quality visibility.

The PR removes code quality and coverage plugins (PMD, JaCoCo, PIT mutation testing) while adding formatting tools (Spotless, Checkstyle). While formatting is valuable, the removal of coverage reporting and static analysis represents a reduction in quality tooling.

Consider retaining JaCoCo for test coverage metrics, especially given that several test classes are being disabled in this PR.

Comment on lines +1 to +13
package org.fungover.zipp.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HealthController {

@GetMapping("/health")
public String health() {
return "OK";
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix Spotless formatting violations.

The CI pipeline is failing due to formatting issues. Run mvn spotless:apply to resolve.

🧰 Tools
🪛 GitHub Actions: CI Pipeline

[error] 1-1: Spotless formatting violations detected. Run 'mvn spotless:apply' to fix code style issues in this file.

🤖 Prompt for AI Agents
In `@backend/src/main/java/org/fungover/zipp/controller/HealthController.java`
around lines 1 - 13, The file HealthController (class HealthController, method
health()) has Spotless formatting violations; run the formatter to fix them by
executing mvn spotless:apply and then commit the resulting changes (or apply
your IDE's Spotless/format settings) so the HealthController.java formatting
matches the project's Spotless rules and CI passes.

Comment on lines +1 to +14
//package org.fungover.zipp;
//
//import org.junit.jupiter.api.Test;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.context.annotation.Import;
//
//@Import(TestcontainersConfiguration.class)
//@SpringBootTest
//class BackendApplicationTests {
//
// @Test
// void contextLoads() {
// }
//}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Delete commented-out test file.

This file is entirely commented out, which triggers Spotless formatting violations and adds technical debt. Since ContextLoadsTest now provides context-load verification, delete this file instead of keeping it commented.

🧰 Tools
🪛 GitHub Actions: CI Pipeline

[error] 1-14: Spotless formatting violations detected. Run 'mvn spotless:apply' to fix code style issues in this file.

🤖 Prompt for AI Agents
In `@backend/src/test/java/org/fungover/zipp/BackendApplicationTests.java` around
lines 1 - 14, Remove the entirely commented-out test class
BackendApplicationTests (the file containing the commented package/imports and
the BackendApplicationTests class) from the repository; since ContextLoadsTest
already covers context loading, delete this file to eliminate the commented code
and resolve Spotless formatting violations rather than leaving the
BackendApplicationTests.java with commented content.

Comment on lines +1 to +17
package org.fungover.zipp;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.kafka.test.context.EmbeddedKafka;

//This is just a test-file. Allowed to be removed.
@SpringBootTest
@ActiveProfiles("test")
@EmbeddedKafka(partitions = 1, topics = {"test-topic"})
class ContextLoadsTest {

@Test
void contextLoads() {
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix Spotless formatting violations.

The CI pipeline is failing due to formatting issues. Run mvn spotless:apply to resolve.

🧰 Tools
🪛 GitHub Actions: CI Pipeline

[error] 1-1: Spotless formatting violations detected. Run 'mvn spotless:apply' to fix code style issues in ContextLoadsTest.java.

🤖 Prompt for AI Agents
In `@backend/src/test/java/org/fungover/zipp/ContextLoadsTest.java` around lines 1
- 17, The file ContextLoadsTest (class ContextLoadsTest, method contextLoads)
has Spotless formatting violations; run the formatter (mvn spotless:apply) to
reformat this test file and commit the changes so imports, spacing, and header
comments comply with Spotless rules (or manually adjust formatting to match the
project's Spotless configuration if you prefer), then re-run the build to
confirm the CI formatting error is resolved.

Comment on lines +9 to +11
@SpringBootTest
@ActiveProfiles("test")
@EmbeddedKafka(partitions = 1, topics = {"test-topic"})
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if any test class uses `@SpringBootTest` without `@EmbeddedKafka` under the test profile
echo "=== Test classes with `@SpringBootTest` ==="
rg -l "@SpringBootTest" --type java backend/src/test/

echo ""
echo "=== Test classes with `@EmbeddedKafka` ==="
rg -l "@EmbeddedKafka" --type java backend/src/test/

echo ""
echo "=== Check application-test.yml for embedded kafka reference ==="
cat backend/src/main/resources/application-test.yml

Repository: fungover/zipp

Length of output: 1039


Standardize Kafka configuration across all test classes.

The application-test.yml explicitly references ${spring.embedded.kafka.brokers}, which requires an embedded Kafka broker to be available. Currently, only ContextLoadsTest uses @EmbeddedKafka. Three other test classes—HealthIntegrationTest, AuthenticationIntegrationTest, and BackendApplicationTests—also use @SpringBootTest with the test profile but lack @EmbeddedKafka, meaning their Spring contexts will fail when trying to resolve the Kafka property.

Either add @EmbeddedKafka to all test classes that use the test profile, or modify application-test.yml to provide a default value for spring.embedded.kafka.brokers when embedded Kafka is unavailable.

🤖 Prompt for AI Agents
In `@backend/src/test/java/org/fungover/zipp/ContextLoadsTest.java` around lines 9
- 11, Four test classes load the "test" profile but only ContextLoadsTest has
`@EmbeddedKafka`, causing ${spring.embedded.kafka.brokers} to be unresolved in
others; fix by either (A) adding `@EmbeddedKafka`(partitions = 1, topics =
{"test-topic"}) to HealthIntegrationTest, AuthenticationIntegrationTest, and
BackendApplicationTests (so the embedded broker exists when Spring resolves
spring.embedded.kafka.brokers) or (B) update application-test.yml to give
spring.embedded.kafka.brokers a safe default (e.g.,
spring.embedded.kafka.brokers: ${SPRING_EMBEDDED_KAFKA_BROKERS:} or a
blank/default value) so tests without the EmbeddedKafka annotation can start;
choose one approach and apply it consistently to all classes (ContextLoadsTest,
HealthIntegrationTest, AuthenticationIntegrationTest, BackendApplicationTests).

Comment on lines +24 to +27
}



Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix Spotless formatting violations (pipeline failure).

The CI pipeline reports Spotless formatting violations. The trailing blank lines at the end of the file likely contribute to this. Run mvn spotless:apply to fix.

     }
 }
-
-
-
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
}
}
}
🤖 Prompt for AI Agents
In
`@backend/src/test/java/org/fungover/zipp/integration/HealthIntegrationTest.java`
around lines 24 - 27, The file HealthIntegrationTest has Spotless formatting
violations due to trailing blank lines at the end of the file; open the
HealthIntegrationTest class file, remove extra blank lines so the file ends with
a single newline, and then run mvn spotless:apply (or your IDE's Spotless
formatter) to reformat and update the file to satisfy Spotless checks.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
backend/pom.xml (1)

329-335: ⚠️ Potential issue | 🟠 Major

Add pitest-junit5-plugin dependency to enable JUnit 5 test discovery in mutation testing

The project extensively uses JUnit 5 tests (confirmed across all test files with org.junit.jupiter imports), but the pitest-maven plugin has an empty <dependencies> block. Pitest requires the pitest-junit5-plugin dependency to discover and run JUnit 5 tests. Without it, mutation testing will silently skip all tests in this project.

Add the following to the empty <dependencies> block:

<dependency>
  <groupId>org.pitest</groupId>
  <artifactId>pitest-junit5-plugin</artifactId>
  <version>1.1.2</version>
</dependency>
🤖 Fix all issues with AI agents
In `@backend/pom.xml`:
- Around line 194-199: Remove the hardcoded <version> element from the
dependency entry for artifactId "spring-boot-test" (groupId
"org.springframework.boot") in the POM so the parent BOM
(spring-boot-starter-parent) controls the version; locate the dependency block
with artifactId "spring-boot-test" and delete the <version>4.0.0</version> line,
leaving groupId, artifactId and scope intact.
- Around line 56-60: The H2 dependency currently declared as <dependency> with
groupId=com.h2database and artifactId=h2 uses <scope>runtime</scope>, which will
include the embedded DB on production classpath; change its scope to
<scope>test</scope> so H2 is only present for tests (update the dependency block
for com.h2database:h2 in the POM accordingly).

In `@backend/src/main/java/org/fungover/zipp/entity/HealthEntity.java`:
- Around line 3-12: The HealthEntity class imports the wrong `@Id` annotation;
replace the import of org.springframework.data.annotation.Id with
jakarta.persistence.Id so JPA/Hibernate recognizes the primary key; update the
import in HealthEntity and ensure the class keeps `@Entity`, `@Id` and
`@GeneratedValue` on the id field (reference: HealthEntity, `@Id`, `@GeneratedValue`)
to match other entities like User and ReportImageEntity.

In `@backend/src/test/resources/application-test.yml`:
- Around line 1-3: Replace the unsupported property spring.kafka.enabled: false
in the test application YAML with the Spring Boot auto-configuration exclusion
property: set spring.autoconfigure.exclude to the fully-qualified class name
org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration so Kafka
auto-configuration is disabled during tests; update the YAML under the same
spring key to include autoconfigure.exclude with that class name instead of
using spring.kafka.enabled.
🧹 Nitpick comments (3)
backend/pom.xml (1)

103-107: Remove the commented-out dependency instead of leaving dead XML.

Commented-out code adds noise and is already tracked in version control. If spring-boot-docker-compose is no longer needed, delete the block.

🧹 Proposed fix
-<!--    <dependency>-->
-<!--      <groupId>org.springframework.boot</groupId>-->
-<!--      <artifactId>spring-boot-docker-compose</artifactId>-->
-<!--      <scope>runtime</scope>-->
-<!--    </dependency>-->
backend/src/main/java/org/fungover/zipp/entity/HealthEntity.java (1)

8-23: Top-level class body should not be indented.

The entire class (Lines 8–23) has an extra level of indentation that is non-standard for a top-level class in Java. This is likely contributing to the Spotless CI failure.

Also consider adding a @Table annotation for explicit table naming, consistent with other entities in the project (e.g., @Table(name = "users") on User, @Table(name = "report_images") on ReportImageEntity).

backend/src/test/java/org/fungover/zipp/integration/HealthIntegrationTest.java (1)

26-37: Test bypasses the HTTP layer — consider what's actually being validated.

Calling healthController.health() directly tests the method's return value but skips request mapping, content negotiation, and security filters. The persistence assertions (Lines 32–37) verify that Spring Data JPA wiring works, but saving a manually-constructed entity isn't something the /health endpoint does — so this conflates two unrelated concerns.

This is acknowledged in the PR description, so flagging for awareness only. When HTTP-level testing is feasible, consider using MockMvc or TestRestTemplate to exercise the full stack.

Comment on lines +56 to +60
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

H2 should be test scope, not runtime.

With runtime scope, H2 is included on the classpath in production. Since this database is only intended for integration tests (backed by the application-test.yml config), it should be scoped to test to avoid accidentally shipping an embedded database to production.

🔧 Proposed fix
     <dependency>
       <groupId>com.h2database</groupId>
       <artifactId>h2</artifactId>
-      <scope>runtime</scope>
+      <scope>test</scope>
     </dependency>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
🤖 Prompt for AI Agents
In `@backend/pom.xml` around lines 56 - 60, The H2 dependency currently declared
as <dependency> with groupId=com.h2database and artifactId=h2 uses
<scope>runtime</scope>, which will include the embedded DB on production
classpath; change its scope to <scope>test</scope> so H2 is only present for
tests (update the dependency block for com.h2database:h2 in the POM
accordingly).

Comment on lines 194 to 199
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<artifactId>spring-boot-test</artifactId>
<version>4.0.0</version>
<scope>test</scope>
</dependency>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Remove the hardcoded version — the parent BOM already manages spring-boot-test.

The parent spring-boot-starter-parent:4.0.0 already defines the version for spring-boot-test. Pinning <version>4.0.0</version> here is redundant and will silently diverge if the parent version is bumped.

🔧 Proposed fix
     <dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-test</artifactId>
-      <version>4.0.0</version>
       <scope>test</scope>
     </dependency>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<artifactId>spring-boot-test</artifactId>
<version>4.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<scope>test</scope>
</dependency>
🤖 Prompt for AI Agents
In `@backend/pom.xml` around lines 194 - 199, Remove the hardcoded <version>
element from the dependency entry for artifactId "spring-boot-test" (groupId
"org.springframework.boot") in the POM so the parent BOM
(spring-boot-starter-parent) controls the version; locate the dependency block
with artifactId "spring-boot-test" and delete the <version>4.0.0</version> line,
leaving groupId, artifactId and scope intact.

Comment on lines +3 to +12
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import org.springframework.data.annotation.Id;


@Entity
public class HealthEntity {
@Id
@GeneratedValue
private Long id;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Wrong @Id import — JPA will not recognize the primary key.

Line 5 imports org.springframework.data.annotation.Id (Spring Data generic marker) instead of jakarta.persistence.Id (JPA). Hibernate will fail at runtime with an error like "No identifier specified for entity: HealthEntity" because it cannot find a JPA-annotated primary key.

All other entities in this codebase (e.g., User.java, ReportImageEntity.java, ApiKey.java) correctly use jakarta.persistence.Id.

🐛 Proposed fix
 import jakarta.persistence.Entity;
 import jakarta.persistence.GeneratedValue;
-import org.springframework.data.annotation.Id;
+import jakarta.persistence.Id;
🤖 Prompt for AI Agents
In `@backend/src/main/java/org/fungover/zipp/entity/HealthEntity.java` around
lines 3 - 12, The HealthEntity class imports the wrong `@Id` annotation; replace
the import of org.springframework.data.annotation.Id with jakarta.persistence.Id
so JPA/Hibernate recognizes the primary key; update the import in HealthEntity
and ensure the class keeps `@Entity`, `@Id` and `@GeneratedValue` on the id field
(reference: HealthEntity, `@Id`, `@GeneratedValue`) to match other entities like
User and ReportImageEntity.

Comment on lines +1 to +3
spring:
kafka:
enabled: false
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Spring Boot 4.0.0 spring.kafka.enabled property documentation

💡 Result:

spring.kafka.enabled is not a documented (or supported) Spring Boot 4.0.x property, and Spring Boot does not provide a single “enable/disable Kafka auto-configuration” toggle under spring.kafka.*. The official “Common Application Properties” list contains many spring.kafka.* entries (e.g., spring.kafka.jaas.enabled, spring.kafka.retry.topic.enabled, etc.) but no spring.kafka.enabled entry. [1] The Spring Boot team also discussed this explicitly in an issue requesting spring.kafka.enabled, which was closed without adding such a property. [2]

How to disable Kafka auto-configuration instead (Spring Boot 4.0)

Use Spring Boot’s standard auto-configuration exclusion mechanism:

application.properties

spring.autoconfigure.exclude=org.springframework.boot.kafka.autoconfigure.KafkaAutoConfiguration

Spring Boot documents spring.autoconfigure.exclude as the property-based way to disable specific auto-configuration classes. [3] The Kafka auto-config class you’d exclude is org.springframework.boot.kafka.autoconfigure.KafkaAutoConfiguration. [4]

If you also want to exclude Kafka metrics auto-config, Spring Boot lists KafkaMetricsAutoConfiguration in the spring-boot-kafka module’s auto-configurations. [5]

application.properties

spring.autoconfigure.exclude=org.springframework.boot.kafka.autoconfigure.KafkaAutoConfiguration,org.springframework.boot.kafka.autoconfigure.KafkaMetricsAutoConfiguration

Sources: [1] [2] [3] [4] [5]


Replace spring.kafka.enabled: false with the valid Spring Boot auto-configuration exclusion property.

spring.kafka.enabled is not a supported property in Spring Boot 4.0.x. To disable Kafka auto-configuration, use:

spring:
  autoconfigure:
    exclude: org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration

Without this change, Kafka will continue to auto-configure in tests, which may cause failures if Kafka is not available.

🧰 Tools
🪛 GitHub Actions: CI Pipeline

[error] 1-1: Command failed: mvn spotless:check


[error] 1-1: Spotless check failed. Formatting violations detected in multiple files. Run 'mvn spotless:apply' to fix. Affected files include src/test/java/org/fungover/zipp/integration/HealthIntegrationTest.java, src/test/java/org/fungover/zipp/TestcontainersConfiguration.java, src/test/java/org/fungover/zipp/authtest/AuthenticationIntegrationTest.java, and other Health-related source files such as src/main/java/org/fungover/zipp/entity/HealthEntity.java, src/main/java/org/fungover/zipp/controller/HealthController.java, src/main/java/org/fungover/zipp/repository/HealthRepository.java.

🤖 Prompt for AI Agents
In `@backend/src/test/resources/application-test.yml` around lines 1 - 3, Replace
the unsupported property spring.kafka.enabled: false in the test application
YAML with the Spring Boot auto-configuration exclusion property: set
spring.autoconfigure.exclude to the fully-qualified class name
org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration so Kafka
auto-configuration is disabled during tests; update the YAML under the same
spring key to include autoconfigure.exclude with that class name instead of
using spring.kafka.enabled.

@Patseroni Patseroni changed the title Integration test/115 Simple integration test Feb 6, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
backend/pom.xml (1)

329-335: ⚠️ Potential issue | 🔴 Critical

Removing pitest-junit5-plugin breaks PITest mutation testing for JUnit 5 tests.

The <dependencies> block of the pitest-maven plugin is now empty. PITest requires the pitest-junit5-plugin to discover and execute JUnit 5 tests. Without it, PITest will silently find zero tests and report misleading coverage/mutation results, or fail the configured thresholds.

Proposed fix — restore the plugin dependency
       <dependencies>
-
+        <dependency>
+          <groupId>org.pitest</groupId>
+          <artifactId>pitest-junit5-plugin</artifactId>
+          <version>1.2.1</version>
+        </dependency>
       </dependencies>
🤖 Fix all issues with AI agents
In `@backend/pom.xml`:
- Around line 356-358: The Spotless check is failing due to formatting
violations (trailing blank lines) in backend/pom.xml; run mvn spotless:apply in
the repository root to auto-fix formatting, or manually remove the extra blank
lines at the end of backend/pom.xml so the file ends with a single newline, then
commit the updated pom.xml so the CI Spotless check passes.

Comment on lines 356 to +358
</project>


Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Pipeline is failing due to Spotless formatting violations.

The CI pipeline reports: "Spotless check reported formatting violations across the project." The trailing blank lines at the end of this file (lines 357–358) may be part of this. Run mvn spotless:apply and commit the result.

🤖 Prompt for AI Agents
In `@backend/pom.xml` around lines 356 - 358, The Spotless check is failing due to
formatting violations (trailing blank lines) in backend/pom.xml; run mvn
spotless:apply in the repository root to auto-fix formatting, or manually remove
the extra blank lines at the end of backend/pom.xml so the file ends with a
single newline, then commit the updated pom.xml so the CI Spotless check passes.

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