refactor: remove all ClickHouse code, old interfaces, and SQL migrations
- Delete all ClickHouse storage implementations and config - Delete old core interfaces (ExecutionRepository, DiagramRepository, MetricsRepository, SearchEngine, RawExecutionRow) - Delete ClickHouse SQL migration files - Delete AbstractClickHouseIT - Update controllers to use new store interfaces (DiagramStore, ExecutionStore) - Fix IngestionService calls in controllers for new synchronous API - Migrate all ITs from AbstractClickHouseIT to AbstractPostgresIT - Fix count() syntax and remove ClickHouse-specific test assertions - Update TreeReconstructionTest for new buildTree() method Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,82 +0,0 @@
|
||||
package com.cameleer3.server.app;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.DynamicPropertyRegistry;
|
||||
import org.springframework.test.context.DynamicPropertySource;
|
||||
import org.testcontainers.clickhouse.ClickHouseContainer;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.Statement;
|
||||
|
||||
/**
|
||||
* Base class for integration tests requiring a ClickHouse instance.
|
||||
* <p>
|
||||
* Uses Testcontainers to spin up a ClickHouse server and initializes the schema
|
||||
* from {@code clickhouse/init/01-schema.sql} before the first test runs.
|
||||
* Subclasses get a {@link JdbcTemplate} for direct database assertions.
|
||||
* <p>
|
||||
* Container lifecycle is managed manually (started once, shared across all test classes).
|
||||
*/
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@ActiveProfiles("test")
|
||||
public abstract class AbstractClickHouseIT {
|
||||
|
||||
protected static final ClickHouseContainer CLICKHOUSE;
|
||||
|
||||
static {
|
||||
CLICKHOUSE = new ClickHouseContainer("clickhouse/clickhouse-server:25.3");
|
||||
CLICKHOUSE.start();
|
||||
}
|
||||
|
||||
@Autowired
|
||||
protected JdbcTemplate jdbcTemplate;
|
||||
|
||||
@DynamicPropertySource
|
||||
static void overrideProperties(DynamicPropertyRegistry registry) {
|
||||
registry.add("spring.datasource.url", CLICKHOUSE::getJdbcUrl);
|
||||
registry.add("spring.datasource.username", CLICKHOUSE::getUsername);
|
||||
registry.add("spring.datasource.password", CLICKHOUSE::getPassword);
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
static void initSchema() throws Exception {
|
||||
// Surefire runs from the module directory; schema is in the project root
|
||||
Path baseDir = Path.of("clickhouse/init");
|
||||
if (!Files.exists(baseDir)) {
|
||||
baseDir = Path.of("../clickhouse/init");
|
||||
}
|
||||
|
||||
// Load all schema files in order
|
||||
String[] schemaFiles = {"01-schema.sql", "02-search-columns.sql", "03-users.sql", "04-oidc-config.sql", "05-oidc-auto-signup.sql"};
|
||||
|
||||
try (Connection conn = DriverManager.getConnection(
|
||||
CLICKHOUSE.getJdbcUrl(),
|
||||
CLICKHOUSE.getUsername(),
|
||||
CLICKHOUSE.getPassword());
|
||||
Statement stmt = conn.createStatement()) {
|
||||
|
||||
for (String schemaFile : schemaFiles) {
|
||||
Path schemaPath = baseDir.resolve(schemaFile);
|
||||
if (Files.exists(schemaPath)) {
|
||||
String sql = Files.readString(schemaPath, StandardCharsets.UTF_8);
|
||||
// Execute each statement separately (separated by semicolons)
|
||||
for (String statement : sql.split(";")) {
|
||||
String trimmed = statement.trim();
|
||||
if (!trimmed.isEmpty()) {
|
||||
stmt.execute(trimmed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.cameleer3.server.app;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.test.context.DynamicPropertyRegistry;
|
||||
import org.springframework.test.context.DynamicPropertySource;
|
||||
import org.testcontainers.containers.PostgreSQLContainer;
|
||||
@@ -18,6 +20,9 @@ public abstract class AbstractPostgresIT {
|
||||
.withUsername("cameleer")
|
||||
.withPassword("test");
|
||||
|
||||
@Autowired
|
||||
protected JdbcTemplate jdbcTemplate;
|
||||
|
||||
@DynamicPropertySource
|
||||
static void configureProperties(DynamicPropertyRegistry registry) {
|
||||
registry.add("spring.datasource.url", postgres::getJdbcUrl);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@@ -18,7 +18,7 @@ import java.util.UUID;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class AgentCommandControllerIT extends AbstractClickHouseIT {
|
||||
class AgentCommandControllerIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@@ -16,7 +16,7 @@ import org.springframework.http.ResponseEntity;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class AgentRegistrationControllerIT extends AbstractClickHouseIT {
|
||||
class AgentRegistrationControllerIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@@ -30,7 +30,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.awaitility.Awaitility.await;
|
||||
|
||||
class AgentSseControllerIT extends AbstractClickHouseIT {
|
||||
class AgentSseControllerIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import com.cameleer3.server.core.ingestion.IngestionService;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@@ -13,21 +13,20 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.awaitility.Awaitility.await;
|
||||
|
||||
/**
|
||||
* Tests backpressure behavior when write buffers are full.
|
||||
* Uses a tiny buffer (capacity=5) and a very long flush interval
|
||||
* to prevent the scheduler from draining the buffer during the test.
|
||||
* Tests backpressure behavior when the metrics write buffer is full.
|
||||
* <p>
|
||||
* Execution and diagram ingestion are now synchronous (no buffers).
|
||||
* Only the metrics pipeline still uses a write buffer with backpressure.
|
||||
*/
|
||||
@TestPropertySource(properties = {
|
||||
"ingestion.buffer-capacity=5",
|
||||
"ingestion.batch-size=5",
|
||||
"ingestion.flush-interval-ms=60000" // 60s -- effectively no flush during test
|
||||
})
|
||||
class BackpressureIT extends AbstractClickHouseIT {
|
||||
class BackpressureIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
@@ -47,34 +46,31 @@ class BackpressureIT extends AbstractClickHouseIT {
|
||||
}
|
||||
|
||||
@Test
|
||||
void whenBufferFull_returns503WithRetryAfter() {
|
||||
// Wait for any initial scheduled flush to complete, then fill buffer via batch POST
|
||||
await().atMost(5, SECONDS).until(() -> ingestionService.getExecutionBufferDepth() == 0);
|
||||
|
||||
// Fill the buffer completely with a batch of 5
|
||||
void whenMetricsBufferFull_returns503WithRetryAfter() {
|
||||
// Fill the metrics buffer completely with a batch of 5
|
||||
String batchJson = """
|
||||
[
|
||||
{"routeId":"bp-0","exchangeId":"bp-e0","status":"COMPLETED","startTime":"2026-03-11T10:00:00Z","durationMs":100,"processors":[]},
|
||||
{"routeId":"bp-1","exchangeId":"bp-e1","status":"COMPLETED","startTime":"2026-03-11T10:00:00Z","durationMs":100,"processors":[]},
|
||||
{"routeId":"bp-2","exchangeId":"bp-e2","status":"COMPLETED","startTime":"2026-03-11T10:00:00Z","durationMs":100,"processors":[]},
|
||||
{"routeId":"bp-3","exchangeId":"bp-e3","status":"COMPLETED","startTime":"2026-03-11T10:00:00Z","durationMs":100,"processors":[]},
|
||||
{"routeId":"bp-4","exchangeId":"bp-e4","status":"COMPLETED","startTime":"2026-03-11T10:00:00Z","durationMs":100,"processors":[]}
|
||||
{"agentId":"bp-agent","timestamp":"2026-03-11T10:00:00Z","metrics":{}},
|
||||
{"agentId":"bp-agent","timestamp":"2026-03-11T10:00:01Z","metrics":{}},
|
||||
{"agentId":"bp-agent","timestamp":"2026-03-11T10:00:02Z","metrics":{}},
|
||||
{"agentId":"bp-agent","timestamp":"2026-03-11T10:00:03Z","metrics":{}},
|
||||
{"agentId":"bp-agent","timestamp":"2026-03-11T10:00:04Z","metrics":{}}
|
||||
]
|
||||
""";
|
||||
|
||||
ResponseEntity<String> batchResponse = restTemplate.postForEntity(
|
||||
"/api/v1/data/executions",
|
||||
"/api/v1/data/metrics",
|
||||
new HttpEntity<>(batchJson, authHeaders),
|
||||
String.class);
|
||||
assertThat(batchResponse.getStatusCode()).isEqualTo(HttpStatus.ACCEPTED);
|
||||
|
||||
// Now buffer should be full -- next POST should get 503
|
||||
String overflowJson = """
|
||||
{"routeId":"bp-overflow","exchangeId":"bp-overflow-e","status":"COMPLETED","startTime":"2026-03-11T10:00:00Z","durationMs":100,"processors":[]}
|
||||
[{"agentId":"bp-agent","timestamp":"2026-03-11T10:00:05Z","metrics":{}}]
|
||||
""";
|
||||
|
||||
ResponseEntity<String> response = restTemplate.postForEntity(
|
||||
"/api/v1/data/executions",
|
||||
"/api/v1/data/metrics",
|
||||
new HttpEntity<>(overflowJson, authHeaders),
|
||||
String.class);
|
||||
|
||||
@@ -83,25 +79,17 @@ class BackpressureIT extends AbstractClickHouseIT {
|
||||
}
|
||||
|
||||
@Test
|
||||
void bufferedDataNotLost_afterBackpressure() {
|
||||
// Post data to the diagram buffer (separate from executions used above)
|
||||
for (int i = 0; i < 3; i++) {
|
||||
String json = String.format("""
|
||||
{
|
||||
"routeId": "bp-persist-diagram-%d",
|
||||
"version": 1,
|
||||
"nodes": [],
|
||||
"edges": []
|
||||
}
|
||||
""", i);
|
||||
void executionIngestion_isSynchronous_returnsAccepted() {
|
||||
String json = """
|
||||
{"routeId":"bp-sync","exchangeId":"bp-sync-e","status":"COMPLETED","startTime":"2026-03-11T10:00:00Z","durationMs":100,"processors":[]}
|
||||
""";
|
||||
|
||||
restTemplate.postForEntity(
|
||||
"/api/v1/data/diagrams",
|
||||
new HttpEntity<>(json, authHeaders),
|
||||
String.class);
|
||||
}
|
||||
ResponseEntity<String> response = restTemplate.postForEntity(
|
||||
"/api/v1/data/executions",
|
||||
new HttpEntity<>(json, authHeaders),
|
||||
String.class);
|
||||
|
||||
// Data is in the buffer. Verify the buffer has data.
|
||||
assertThat(ingestionService.getDiagramBufferDepth()).isGreaterThanOrEqualTo(3);
|
||||
// Synchronous ingestion always returns 202 (no buffer to overflow)
|
||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.ACCEPTED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@@ -23,7 +23,7 @@ import static org.awaitility.Awaitility.await;
|
||||
* Integration tests for the detail and processor snapshot endpoints.
|
||||
*/
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
class DetailControllerIT extends AbstractClickHouseIT {
|
||||
class DetailControllerIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
@@ -121,7 +121,7 @@ class DetailControllerIT extends AbstractClickHouseIT {
|
||||
// Wait for flush and get the execution_id
|
||||
await().atMost(10, SECONDS).untilAsserted(() -> {
|
||||
Integer count = jdbcTemplate.queryForObject(
|
||||
"SELECT count() FROM route_executions WHERE route_id = 'detail-test-route'",
|
||||
"SELECT count(*) FROM route_executions WHERE route_id = 'detail-test-route'",
|
||||
Integer.class);
|
||||
assertThat(count).isGreaterThanOrEqualTo(1);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -15,7 +15,7 @@ import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.awaitility.Awaitility.await;
|
||||
|
||||
class DiagramControllerIT extends AbstractClickHouseIT {
|
||||
class DiagramControllerIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
@@ -53,7 +53,7 @@ class DiagramControllerIT extends AbstractClickHouseIT {
|
||||
}
|
||||
|
||||
@Test
|
||||
void postDiagram_dataAppearsInClickHouseAfterFlush() {
|
||||
void postDiagram_dataAppearsAfterFlush() {
|
||||
String json = """
|
||||
{
|
||||
"routeId": "diagram-flush-route",
|
||||
@@ -72,7 +72,7 @@ class DiagramControllerIT extends AbstractClickHouseIT {
|
||||
|
||||
await().atMost(10, SECONDS).untilAsserted(() -> {
|
||||
Integer count = jdbcTemplate.queryForObject(
|
||||
"SELECT count() FROM route_diagrams WHERE route_id = 'diagram-flush-route'",
|
||||
"SELECT count(*) FROM route_diagrams WHERE route_id = 'diagram-flush-route'",
|
||||
Integer.class);
|
||||
assertThat(count).isGreaterThanOrEqualTo(1);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -20,7 +20,7 @@ import static org.awaitility.Awaitility.await;
|
||||
* Integration tests for {@link DiagramRenderController}.
|
||||
* Seeds a diagram via the ingestion endpoint, then tests rendering.
|
||||
*/
|
||||
class DiagramRenderControllerIT extends AbstractClickHouseIT {
|
||||
class DiagramRenderControllerIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
@@ -61,7 +61,7 @@ class DiagramRenderControllerIT extends AbstractClickHouseIT {
|
||||
new HttpEntity<>(json, securityHelper.authHeaders(jwt)),
|
||||
String.class);
|
||||
|
||||
// Wait for flush to ClickHouse and retrieve the content hash
|
||||
// Wait for flush to storage and retrieve the content hash
|
||||
await().atMost(10, SECONDS).untilAsserted(() -> {
|
||||
String hash = jdbcTemplate.queryForObject(
|
||||
"SELECT content_hash FROM route_diagrams WHERE route_id = 'render-test-route' LIMIT 1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -16,7 +16,7 @@ import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.awaitility.Awaitility.await;
|
||||
|
||||
class ExecutionControllerIT extends AbstractClickHouseIT {
|
||||
class ExecutionControllerIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
@@ -90,7 +90,7 @@ class ExecutionControllerIT extends AbstractClickHouseIT {
|
||||
}
|
||||
|
||||
@Test
|
||||
void postExecution_dataAppearsInClickHouseAfterFlush() {
|
||||
void postExecution_dataAppearsAfterFlush() {
|
||||
String json = """
|
||||
{
|
||||
"routeId": "flush-test-route",
|
||||
@@ -111,7 +111,7 @@ class ExecutionControllerIT extends AbstractClickHouseIT {
|
||||
|
||||
await().atMost(10, SECONDS).untilAsserted(() -> {
|
||||
Integer count = jdbcTemplate.queryForObject(
|
||||
"SELECT count() FROM route_executions WHERE route_id = 'flush-test-route'",
|
||||
"SELECT count(*) FROM route_executions WHERE route_id = 'flush-test-route'",
|
||||
Integer.class);
|
||||
assertThat(count).isGreaterThanOrEqualTo(1);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -16,7 +16,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Integration test for forward compatibility (API-05).
|
||||
* Verifies that unknown JSON fields in request bodies do not cause deserialization errors.
|
||||
*/
|
||||
class ForwardCompatIT extends AbstractClickHouseIT {
|
||||
class ForwardCompatIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||
@@ -8,9 +8,9 @@ import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Integration tests for the health endpoint and ClickHouse TTL verification.
|
||||
* Integration tests for the health endpoint.
|
||||
*/
|
||||
class HealthControllerIT extends AbstractClickHouseIT {
|
||||
class HealthControllerIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
@@ -28,20 +28,4 @@ class HealthControllerIT extends AbstractClickHouseIT {
|
||||
var response = restTemplate.getForEntity("/api/v1/health", String.class);
|
||||
assertThat(response.getStatusCode().value()).isEqualTo(200);
|
||||
}
|
||||
|
||||
@Test
|
||||
void ttlConfiguredOnRouteExecutions() {
|
||||
String createTable = jdbcTemplate.queryForObject(
|
||||
"SHOW CREATE TABLE route_executions", String.class);
|
||||
assertThat(createTable).containsIgnoringCase("TTL");
|
||||
assertThat(createTable).contains("toIntervalDay(30)");
|
||||
}
|
||||
|
||||
@Test
|
||||
void ttlConfiguredOnAgentMetrics() {
|
||||
String createTable = jdbcTemplate.queryForObject(
|
||||
"SHOW CREATE TABLE agent_metrics", String.class);
|
||||
assertThat(createTable).containsIgnoringCase("TTL");
|
||||
assertThat(createTable).contains("toIntervalDay(30)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -15,7 +15,7 @@ import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.awaitility.Awaitility.await;
|
||||
|
||||
class MetricsControllerIT extends AbstractClickHouseIT {
|
||||
class MetricsControllerIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
@@ -52,7 +52,7 @@ class MetricsControllerIT extends AbstractClickHouseIT {
|
||||
}
|
||||
|
||||
@Test
|
||||
void postMetrics_dataAppearsInClickHouseAfterFlush() {
|
||||
void postMetrics_dataAppearsAfterFlush() {
|
||||
String json = """
|
||||
[{
|
||||
"agentId": "agent-flush-test",
|
||||
@@ -70,7 +70,7 @@ class MetricsControllerIT extends AbstractClickHouseIT {
|
||||
|
||||
await().atMost(10, SECONDS).untilAsserted(() -> {
|
||||
Integer count = jdbcTemplate.queryForObject(
|
||||
"SELECT count() FROM agent_metrics WHERE agent_id = 'agent-flush-test'",
|
||||
"SELECT count(*) FROM agent_metrics WHERE agent_id = 'agent-flush-test'",
|
||||
Integer.class);
|
||||
assertThat(count).isGreaterThanOrEqualTo(1);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||
@@ -10,7 +10,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
/**
|
||||
* Integration tests for OpenAPI documentation endpoints.
|
||||
*/
|
||||
class OpenApiIT extends AbstractClickHouseIT {
|
||||
class OpenApiIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.controller;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@@ -24,7 +24,7 @@ import static org.awaitility.Awaitility.await;
|
||||
* Tests all filter types independently and in combination.
|
||||
*/
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
class SearchControllerIT extends AbstractClickHouseIT {
|
||||
class SearchControllerIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
@@ -155,7 +155,7 @@ class SearchControllerIT extends AbstractClickHouseIT {
|
||||
// Wait for all data to flush
|
||||
await().atMost(10, SECONDS).untilAsserted(() -> {
|
||||
Integer count = jdbcTemplate.queryForObject(
|
||||
"SELECT count() FROM route_executions WHERE route_id LIKE 'search-route-%'",
|
||||
"SELECT count(*) FROM route_executions WHERE route_id LIKE 'search-route-%'",
|
||||
Integer.class);
|
||||
assertThat(count).isEqualTo(10);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.interceptor;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* With security enabled, requests to protected endpoints need JWT auth
|
||||
* to reach the interceptor layer.
|
||||
*/
|
||||
class ProtocolVersionIT extends AbstractClickHouseIT {
|
||||
class ProtocolVersionIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -24,8 +24,7 @@ class OpenSearchIndexIT extends AbstractPostgresIT {
|
||||
|
||||
@Container
|
||||
static final OpensearchContainer<?> opensearch =
|
||||
new OpensearchContainer<>("opensearchproject/opensearch:2.19.0")
|
||||
.withSecurityEnabled(false);
|
||||
new OpensearchContainer<>("opensearchproject/opensearch:2.19.0");
|
||||
|
||||
@DynamicPropertySource
|
||||
static void configureOpenSearch(DynamicPropertyRegistry registry) {
|
||||
@@ -58,7 +57,7 @@ class OpenSearchIndexIT extends AbstractPostgresIT {
|
||||
|
||||
SearchResult<ExecutionSummary> result = searchIndex.search(request);
|
||||
assertTrue(result.total() > 0);
|
||||
assertEquals("search-1", result.items().get(0).executionId());
|
||||
assertEquals("search-1", result.data().get(0).executionId());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.security;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,7 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
/**
|
||||
* Integration tests verifying bootstrap token validation on the registration endpoint.
|
||||
*/
|
||||
class BootstrapTokenIT extends AbstractClickHouseIT {
|
||||
class BootstrapTokenIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.security;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import com.cameleer3.server.core.security.JwtService;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
@@ -20,7 +20,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
/**
|
||||
* Integration tests for the JWT refresh flow.
|
||||
*/
|
||||
class JwtRefreshIT extends AbstractClickHouseIT {
|
||||
class JwtRefreshIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.security;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -19,7 +19,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Integration tests verifying that registration returns security credentials
|
||||
* and that those credentials can be used to access protected endpoints.
|
||||
*/
|
||||
class RegistrationSecurityIT extends AbstractClickHouseIT {
|
||||
class RegistrationSecurityIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.security;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -19,7 +19,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Integration tests verifying that the SecurityFilterChain correctly
|
||||
* protects endpoints and allows public access where configured.
|
||||
*/
|
||||
class SecurityFilterIT extends AbstractClickHouseIT {
|
||||
class SecurityFilterIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.security;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.core.security.Ed25519SigningService;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@@ -44,7 +44,7 @@ import static org.awaitility.Awaitility.await;
|
||||
* open SSE stream (with JWT query param) -> push config-update command (with JWT) ->
|
||||
* receive SSE event -> verify signature field against server's Ed25519 public key.
|
||||
*/
|
||||
class SseSigningIT extends AbstractClickHouseIT {
|
||||
class SseSigningIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.storage;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -19,7 +19,7 @@ import static org.awaitility.Awaitility.await;
|
||||
* Integration test proving that diagram_content_hash is populated during
|
||||
* execution ingestion when a RouteGraph exists for the same route+agent.
|
||||
*/
|
||||
class DiagramLinkingIT extends AbstractClickHouseIT {
|
||||
class DiagramLinkingIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cameleer3.server.app.storage;
|
||||
|
||||
import com.cameleer3.server.app.AbstractClickHouseIT;
|
||||
import com.cameleer3.server.app.AbstractPostgresIT;
|
||||
import com.cameleer3.server.app.TestSecurityHelper;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -22,7 +22,7 @@ import static org.awaitility.Awaitility.await;
|
||||
* Integration test verifying that Phase 2 schema columns are correctly populated
|
||||
* during ingestion of route executions with nested processors and exchange data.
|
||||
*/
|
||||
class IngestionSchemaIT extends AbstractClickHouseIT {
|
||||
class IngestionSchemaIT extends AbstractPostgresIT {
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate restTemplate;
|
||||
|
||||
Reference in New Issue
Block a user