4848@ Testcontainers
4949@ Tag ("testcontainers" )
5050public class DaprFeignIT {
51+ public static final String BINDING_NAME = "postgresbinding" ;
5152 private static final String CONNECTION_STRING =
5253 "host=postgres-repository user=postgres password=password port=5432 connect_timeout=10 database=dapr_db_repository" ;
53-
5454 private static final Map <String , String > BINDING_PROPERTIES = Map .of ("connectionString" , CONNECTION_STRING );
55-
5655 private static final Network DAPR_NETWORK = Network .newNetwork ();
57-
58- public static final String BINDING_NAME = "postgresbinding" ;
59-
6056 private static final int APP_PORT = 8080 ;
61- private static final String SUBSCRIPTION_MESSAGE_PATTERN = ".*app is subscribed to the following topics .*" ;
57+ private static final String SUBSCRIPTION_MESSAGE_PATTERN = ".*App entered healthy status .*" ;
6258
6359 @ Container
6460 private static final PostgreSQLContainer <?> POSTGRE_SQL_CONTAINER = new PostgreSQLContainer <>("postgres:16-alpine" )
@@ -73,14 +69,17 @@ public class DaprFeignIT {
7369 private static final DaprContainer DAPR_CONTAINER = new DaprContainer (IMAGE_TAG )
7470 .withAppName ("dapr-feign-test" )
7571 .withNetwork (DAPR_NETWORK )
76- .withComponent (new Component ("pubsub" , "pubsub.in-memory" , "v1" , Collections .emptyMap ()))
7772 .withComponent (new Component (BINDING_NAME , "bindings.postgresql" , "v1" , BINDING_PROPERTIES ))
7873 .withDaprLogLevel (DaprLogLevel .DEBUG )
7974 .withAppPort (APP_PORT )
8075 .withAppHealthCheckPath ("/ready" )
8176 .withAppChannelAddress ("host.testcontainers.internal" )
8277 .withLogConsumer (outputFrame -> System .out .println (outputFrame .getUtf8String ()))
8378 .dependsOn (POSTGRE_SQL_CONTAINER );
79+ @ Autowired
80+ PostgreBindingClient postgreBindingClient ;
81+ @ Autowired
82+ TestMethodClient testMethodClient ;
8483
8584 @ BeforeAll
8685 public static void beforeAll () {
@@ -93,12 +92,6 @@ public void beforeEach() {
9392 Wait .forLogMessage (SUBSCRIPTION_MESSAGE_PATTERN , 1 ).waitUntilReady (DAPR_CONTAINER );
9493 }
9594
96- @ Autowired
97- PostgreBindingClient postgreBindingClient ;
98-
99- @ Autowired
100- TestMethodClient testMethodClient ;
101-
10295 @ Test
10396 public void invokeBindingTest () {
10497 postgreBindingClient .exec ("CREATE TABLE \" demodata\" (\n " +
0 commit comments