Update TestContainer Condfig to show daprd logs

Signed-off-by: Marc Duiker <marcduiker@users.noreply.github.com>
This commit is contained in:
Marc Duiker 2025-08-29 15:29:56 +02:00
parent 16dac6e1db
commit c65a0457bb
No known key found for this signature in database
GPG Key ID: 6A36EA7754473DD7
9 changed files with 42 additions and 49 deletions

View File

@ -15,6 +15,7 @@ package io.dapr.springboot.examples;
import io.dapr.testcontainers.Component;
import io.dapr.testcontainers.DaprContainer;
import io.dapr.testcontainers.DaprLogLevel;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
@ -34,7 +35,9 @@ public class DaprTestContainersConfig {
.withComponent(new Component("kvstore", "state.in-memory", "v1", Collections.singletonMap("actorStateStore", String.valueOf(true))))
.withAppPort(8080)
.withAppHealthCheckPath("/actuator/health")
.withAppChannelAddress("host.testcontainers.internal");
.withAppChannelAddress("host.testcontainers.internal")
.withDaprLogLevel(DaprLogLevel.INFO)
.withLogConsumer(outputFrame -> System.out.println(outputFrame.getUtf8String()));
}

View File

@ -67,8 +67,8 @@ public class DaprTestContainersConfig {
.withReuseScheduler(reuse)
.withAppHealthCheckPath("/actuator/health")
.withAppChannelAddress("host.testcontainers.internal")
// .withDaprLogLevel(DaprLogLevel.DEBUG)
// .withLogConsumer(outputFrame -> System.out.println(outputFrame.getUtf8String()))
.withDaprLogLevel(DaprLogLevel.INFO)
.withLogConsumer(outputFrame -> System.out.println(outputFrame.getUtf8String()))
.dependsOn(redisContainer);
}
@ -106,7 +106,4 @@ public class DaprTestContainersConfig {
return Network.newNetwork();
}
}
}
}

View File

@ -15,6 +15,7 @@ package io.dapr.springboot.examples;
import io.dapr.testcontainers.Component;
import io.dapr.testcontainers.DaprContainer;
import io.dapr.testcontainers.DaprLogLevel;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
@ -34,10 +35,8 @@ public class DaprTestContainersConfig {
.withComponent(new Component("kvstore", "state.in-memory", "v1", Collections.singletonMap("actorStateStore", String.valueOf(true))))
.withAppPort(8080)
.withAppHealthCheckPath("/actuator/health")
.withAppChannelAddress("host.testcontainers.internal");
.withAppChannelAddress("host.testcontainers.internal")
.withDaprLogLevel(DaprLogLevel.INFO)
.withLogConsumer(outputFrame -> System.out.println(outputFrame.getUtf8String()));
}
}
}

View File

@ -15,6 +15,7 @@ package io.dapr.springboot.examples;
import io.dapr.testcontainers.Component;
import io.dapr.testcontainers.DaprContainer;
import io.dapr.testcontainers.DaprLogLevel;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
@ -34,10 +35,8 @@ public class DaprTestContainersConfig {
.withComponent(new Component("kvstore", "state.in-memory", "v1", Collections.singletonMap("actorStateStore", String.valueOf(true))))
.withAppPort(8080)
.withAppHealthCheckPath("/actuator/health")
.withAppChannelAddress("host.testcontainers.internal");
.withAppChannelAddress("host.testcontainers.internal")
.withDaprLogLevel(DaprLogLevel.INFO)
.withLogConsumer(outputFrame -> System.out.println(outputFrame.getUtf8String()));
}
}
}

View File

@ -15,6 +15,7 @@ package io.dapr.springboot.examples;
import io.dapr.testcontainers.Component;
import io.dapr.testcontainers.DaprContainer;
import io.dapr.testcontainers.DaprLogLevel;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
@ -34,10 +35,8 @@ public class DaprTestContainersConfig {
.withComponent(new Component("kvstore", "state.in-memory", "v1", Collections.singletonMap("actorStateStore", String.valueOf(true))))
.withAppPort(8080)
.withAppHealthCheckPath("/actuator/health")
.withAppChannelAddress("host.testcontainers.internal");
.withAppChannelAddress("host.testcontainers.internal")
.withDaprLogLevel(DaprLogLevel.INFO)
.withLogConsumer(outputFrame -> System.out.println(outputFrame.getUtf8String()));
}
}
}

View File

@ -15,6 +15,7 @@ package io.dapr.springboot.examples;
import io.dapr.testcontainers.Component;
import io.dapr.testcontainers.DaprContainer;
import io.dapr.testcontainers.DaprLogLevel;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
@ -34,10 +35,8 @@ public class DaprTestContainersConfig {
.withComponent(new Component("kvstore", "state.in-memory", "v1", Collections.singletonMap("actorStateStore", String.valueOf(true))))
.withAppPort(8080)
.withAppHealthCheckPath("/actuator/health")
.withAppChannelAddress("host.testcontainers.internal");
.withAppChannelAddress("host.testcontainers.internal")
.withDaprLogLevel(DaprLogLevel.INFO)
.withLogConsumer(outputFrame -> System.out.println(outputFrame.getUtf8String()));
}
}
}

View File

@ -15,6 +15,7 @@ package io.dapr.springboot.examples;
import io.dapr.testcontainers.Component;
import io.dapr.testcontainers.DaprContainer;
import io.dapr.testcontainers.DaprLogLevel;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
@ -34,10 +35,8 @@ public class DaprTestContainersConfig {
.withComponent(new Component("kvstore", "state.in-memory", "v1", Collections.singletonMap("actorStateStore", String.valueOf(true))))
.withAppPort(8080)
.withAppHealthCheckPath("/actuator/health")
.withAppChannelAddress("host.testcontainers.internal");
.withAppChannelAddress("host.testcontainers.internal")
.withDaprLogLevel(DaprLogLevel.INFO)
.withLogConsumer(outputFrame -> System.out.println(outputFrame.getUtf8String()));
}
}
}

View File

@ -15,6 +15,7 @@ package io.dapr.springboot.examples;
import io.dapr.testcontainers.Component;
import io.dapr.testcontainers.DaprContainer;
import io.dapr.testcontainers.DaprLogLevel;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
@ -34,10 +35,8 @@ public class DaprTestContainersConfig {
.withComponent(new Component("kvstore", "state.in-memory", "v1", Collections.singletonMap("actorStateStore", String.valueOf(true))))
.withAppPort(8080)
.withAppHealthCheckPath("/actuator/health")
.withAppChannelAddress("host.testcontainers.internal");
.withAppChannelAddress("host.testcontainers.internal")
.withDaprLogLevel(DaprLogLevel.INFO)
.withLogConsumer(outputFrame -> System.out.println(outputFrame.getUtf8String()));
}
}
}

View File

@ -15,6 +15,7 @@ package io.dapr.springboot.examples;
import io.dapr.testcontainers.Component;
import io.dapr.testcontainers.DaprContainer;
import io.dapr.testcontainers.DaprLogLevel;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
@ -34,10 +35,8 @@ public class DaprTestContainersConfig {
.withComponent(new Component("kvstore", "state.in-memory", "v1", Collections.singletonMap("actorStateStore", String.valueOf(true))))
.withAppPort(8080)
.withAppHealthCheckPath("/actuator/health")
.withAppChannelAddress("host.testcontainers.internal");
.withAppChannelAddress("host.testcontainers.internal")
.withDaprLogLevel(DaprLogLevel.INFO)
.withLogConsumer(outputFrame -> System.out.println(outputFrame.getUtf8String()));
}
}
}