fix tests

This commit is contained in:
stefan 2025-09-05 13:52:45 +02:00
parent f160dd2988
commit 4af276e67a
12 changed files with 77 additions and 13 deletions

View File

@ -215,6 +215,9 @@ NOTES*.md
!platform/
!core/
# Essential documentation for build
!docs/
# ===================================================================
# Final note: Each Dockerfile should copy only what it needs
# This .dockerignore provides a baseline for all builds

View File

@ -1,7 +1,7 @@
# Entwicklungsumgebung spezifische Konfiguration
# Server-Einstellungen
server.port=8081
server.port=8080
# Datenbank-Einstellungen
database.host=localhost

View File

@ -1,7 +1,7 @@
# Produktionsumgebung spezifische Konfiguration
# Server-Einstellungen
server.port=8081
server.port=8080
server.workers=4
server.cors.allowedOrigins=https://meldestelle.at,https://app.meldestelle.at

View File

@ -1,7 +1,7 @@
# Staging-Umgebung spezifische Konfiguration
# Server-Einstellungen
server.port=8081
server.port=8080
server.workers=2
server.cors.allowedOrigins=https://staging.meldestelle.at

View File

@ -4,7 +4,7 @@ app.version=1.0.0
app.description=Pferdesport Meldestelle System
# Server-Einstellungen
server.port=8081
server.port=8080
server.host=0.0.0.0
server.workers=4
server.cors.enabled=true

View File

@ -103,6 +103,38 @@ services:
start_period: 15s
restart: unless-stopped
# ===================================================================
# API Gateway
# ===================================================================
api-gateway:
build:
context: .
dockerfile: infrastructure/gateway/Dockerfile
container_name: meldestelle-api-gateway
environment:
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE:-dev}
CONSUL_HOST: consul
CONSUL_PORT: 8500
CONSUL_ENABLED: true
ports:
- "8080:8080"
depends_on:
consul:
condition: service_healthy
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- meldestelle-network
healthcheck:
test: [ "CMD", "curl", "--fail", "http://localhost:8080/actuator/health" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
# ===================================================================
# Volumes
# ===================================================================

View File

@ -18,6 +18,15 @@ COPY core core/
# Infrastructure Module kopieren (für Dependencies)
COPY infrastructure infrastructure/
# Client Module kopieren (für Dependencies)
COPY client client/
# Documentation Module kopieren (für Dependencies)
COPY docs docs/
# Temporary Module kopieren (für Dependencies)
COPY temp temp/
# Gateway Module bauen
RUN ./gradlew :infrastructure:gateway:bootJar -x test --no-daemon

View File

@ -12,6 +12,15 @@ tasks.getByName("bootJar") {
enabled = false
}
// Deaktiviert bootRun und bootTestRun für dieses Bibliotheks-Modul, da es keine ausführbare Anwendung ist.
tasks.getByName("bootRun") {
enabled = false
}
tasks.getByName("bootTestRun") {
enabled = false
}
dependencies {
// Stellt sicher, dass alle Versionen aus der zentralen BOM kommen.
implementation(platform(projects.platform.platformBom))

View File

@ -12,6 +12,15 @@ tasks.getByName("bootJar") {
enabled = false
}
// Deaktiviert bootRun und bootTestRun für dieses Bibliotheks-Modul, da es keine ausführbare Anwendung ist.
tasks.getByName("bootRun") {
enabled = false
}
tasks.getByName("bootTestRun") {
enabled = false
}
dependencies {
// Stellt sicher, dass alle Versionen aus der zentralen BOM kommen.
api(platform(projects.platform.platformBom))

View File

@ -23,6 +23,10 @@ management.tracing.enabled=false
logging.level.zipkin2=INFO
logging.level.org.springframework.boot.autoconfigure=INFO
# --- Spring Boot Auto-Configuration ---
# Deaktiviert Armeria Auto-Configuration, da Zipkin seinen eigenen Server verwendet
spring.autoconfigure.exclude=com.linecorp.armeria.spring.ArmeriaAutoConfiguration
# Folgende Properties wurden entfernt, da sie den Standardwerten in Zipkin 3.x entsprechen:
# zipkin.ui.enabled=true (UI ist standardmäßig aktiv)
# server.servlet.context-path=/ (Standard-Context-Path ist root)

View File

@ -11,20 +11,18 @@ import org.springframework.context.ApplicationContext
* Testet, ob der Spring Application Context für den Monitoring-Server
* erfolgreich geladen werden kann.
*
* DEAKTIVIERT: Spring context loading fails due to Zipkin/Armeria auto-configuration issues.
* @SpringBootTest annotation removed to prevent context loading during test class initialization.
* Mit der Armeria Auto-Configuration Ausschluss-Konfiguration sollte der Context erfolgreich laden.
* Verwendet RANDOM_PORT um Konflikte mit bootRun-Tasks zu vermeiden.
*/
@Disabled("Spring context loading fails due to Zipkin/Armeria auto-configuration issues - needs investigation")
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class MonitoringServerApplicationTest {
// @Autowired - Removed to prevent Spring dependency injection
// private lateinit var context: ApplicationContext
@Autowired
private lateinit var context: ApplicationContext
@Test
@Disabled("Spring context loading fails due to Zipkin/Armeria auto-configuration issues - needs investigation")
fun `context loads successfully`() {
// Bestätigt, dass der gesamte Server-Kontext erfolgreich gestartet wurde.
// Test disabled due to Spring context loading issues
// assertThat(context).isNotNull()
assertThat(context).isNotNull()
}
}

View File

@ -11,7 +11,7 @@ spring:
health-check-interval: 10s
server:
port: 8082
port: 0
management:
endpoints: