48
48
@ Testcontainers
49
49
@ Tag ("testcontainers" )
50
50
public class DaprFeignIT {
51
+ public static final String BINDING_NAME = "postgresbinding" ;
51
52
private static final String CONNECTION_STRING =
52
53
"host=postgres-repository user=postgres password=password port=5432 connect_timeout=10 database=dapr_db_repository" ;
53
-
54
54
private static final Map <String , String > BINDING_PROPERTIES = Map .of ("connectionString" , CONNECTION_STRING );
55
-
56
55
private static final Network DAPR_NETWORK = Network .newNetwork ();
57
-
58
- public static final String BINDING_NAME = "postgresbinding" ;
59
-
60
56
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 .*" ;
62
58
63
59
@ Container
64
60
private static final PostgreSQLContainer <?> POSTGRE_SQL_CONTAINER = new PostgreSQLContainer <>("postgres:16-alpine" )
@@ -73,14 +69,17 @@ public class DaprFeignIT {
73
69
private static final DaprContainer DAPR_CONTAINER = new DaprContainer (IMAGE_TAG )
74
70
.withAppName ("dapr-feign-test" )
75
71
.withNetwork (DAPR_NETWORK )
76
- .withComponent (new Component ("pubsub" , "pubsub.in-memory" , "v1" , Collections .emptyMap ()))
77
72
.withComponent (new Component (BINDING_NAME , "bindings.postgresql" , "v1" , BINDING_PROPERTIES ))
78
73
.withDaprLogLevel (DaprLogLevel .DEBUG )
79
74
.withAppPort (APP_PORT )
80
75
.withAppHealthCheckPath ("/ready" )
81
76
.withAppChannelAddress ("host.testcontainers.internal" )
82
77
.withLogConsumer (outputFrame -> System .out .println (outputFrame .getUtf8String ()))
83
78
.dependsOn (POSTGRE_SQL_CONTAINER );
79
+ @ Autowired
80
+ PostgreBindingClient postgreBindingClient ;
81
+ @ Autowired
82
+ TestMethodClient testMethodClient ;
84
83
85
84
@ BeforeAll
86
85
public static void beforeAll () {
@@ -93,12 +92,6 @@ public void beforeEach() {
93
92
Wait .forLogMessage (SUBSCRIPTION_MESSAGE_PATTERN , 1 ).waitUntilReady (DAPR_CONTAINER );
94
93
}
95
94
96
- @ Autowired
97
- PostgreBindingClient postgreBindingClient ;
98
-
99
- @ Autowired
100
- TestMethodClient testMethodClient ;
101
-
102
95
@ Test
103
96
public void invokeBindingTest () {
104
97
postgreBindingClient .exec ("CREATE TABLE \" demodata\" (\n " +
0 commit comments