Skip to content

Commit 51cea13

Browse files
committed
Switching to the new cdc service. Fixing tests.
1 parent 62aa45a commit 51cea13

File tree

5 files changed

+27
-16
lines changed

5 files changed

+27
-16
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ target
1414
bin
1515
node_modules
1616
dist
17+
ftgo-api-gateway-graphql/jest_0

build-and-test-all.sh

+15-8
Original file line numberDiff line numberDiff line change
@@ -53,33 +53,40 @@ if [ -z "$ASSEMBLE_ONLY" ] ; then
5353

5454
./gradlew $* integrationTest
5555

56-
5756
# Component tests need to use the per-service database schema
5857

5958
SPRING_DATASOURCE_URL=jdbc:mysql://${DOCKER_HOST_IP?}/ftgoorderservice ./gradlew :ftgo-order-service:cleanComponentTest :ftgo-order-service:componentTest
6059

6160
# Reset the DB/messages
6261

6362
docker-compose down -v
63+
64+
docker-compose up -d dynamodblocal mysql
65+
66+
./wait-for-mysql.sh
67+
68+
echo mysql is started
69+
70+
initializeDynamoDB
71+
6472
docker-compose up -d
6573

6674

6775
else
6876

6977
./gradlew $* assemble
70-
docker-compose up -d --build
7178

72-
fi
79+
docker-compose up -d --build dynamodblocal mysql
7380

74-
./wait-for-mysql.sh
81+
./wait-for-mysql.sh
7582

76-
echo mysql is started
83+
echo mysql is started
7784

78-
initializeDynamoDB
85+
initializeDynamoDB
7986

80-
./wait-for-mysql.sh
87+
docker-compose up -d --build
8188

82-
echo mysql is started
89+
fi
8390

8491
./wait-for-services.sh
8592

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ services:
4343
EVENTUATELOCAL_CDC_BINLOG_CLIENT_ID: 1234567890
4444
EVENTUATELOCAL_CDC_SOURCE_TABLE_NAME: message
4545
eventuate-local-cdc-service:
46-
image: eventuateio/eventuateio-local-cdc-service:0.17.0.RELEASE
46+
image: eventuateio/eventuateio-local-new-cdc-service:0.20.1.RELEASE
4747
ports:
4848
- "8098:8080"
4949
depends_on:

ftgo-order-service/src/component-test/java/net/chrisrichardson/ftgo/orderservice/cucumber/OrderServiceComponentTestStepDefinitions.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,14 @@ public void restaurantAcceptsOrder() {
139139
.when(ConfirmCreateTicket.class).replyWithSuccess()
140140
.when(CancelCreateTicket.class).replyWithSuccess();
141141

142-
domainEventPublisher.publish("net.chrisrichardson.ftgo.restaurantservice.domain.Restaurant", RestaurantMother.AJANTA_ID,
143-
Collections.singletonList(new RestaurantCreated(RestaurantMother.AJANTA_RESTAURANT_NAME, AJANTA_RESTAURANT_MENU)));
144-
145-
eventually(() -> {
146-
FtgoTestUtil.assertPresent(restaurantRepository.findById(RestaurantMother.AJANTA_ID));
147-
});
142+
if (!restaurantRepository.findById(RestaurantMother.AJANTA_ID).isPresent()) {
143+
domainEventPublisher.publish("net.chrisrichardson.ftgo.restaurantservice.domain.Restaurant", RestaurantMother.AJANTA_ID,
144+
Collections.singletonList(new RestaurantCreated(RestaurantMother.AJANTA_RESTAURANT_NAME, AJANTA_RESTAURANT_MENU)));
148145

146+
eventually(() -> {
147+
FtgoTestUtil.assertPresent(restaurantRepository.findById(RestaurantMother.AJANTA_ID));
148+
});
149+
}
149150
}
150151

151152
@When("I place an order for Chicken Vindaloo at Ajanta")

run-end-to-end-tests.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ initializeDynamoDB() {
2323

2424
./gradlew assemble
2525

26-
docker-compose up -d --build
26+
docker-compose up -d --build dynamodblocal mysql
2727

2828
./wait-for-mysql.sh
2929

3030
echo mysql is started
3131

3232
initializeDynamoDB
3333

34+
docker-compose up -d --build
35+
3436
date
3537

3638
./wait-for-services.sh

0 commit comments

Comments
 (0)