X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Fkafka%2Fchat%2Fbackend%2FAbstractConfigurationWithShardingIT.java;h=5c9ac13f5028c29798825fbd29c114a5bc4e6f5b;hb=a8868405a208e0bfd176890b6387fb5c794358e9;hp=e6fd95a9db61904c8389e9e09ed5301d7a4ddc9e;hpb=412635e46c4891f9565f341044878190c5674729;p=demos%2Fkafka%2Fchat diff --git a/src/test/java/de/juplo/kafka/chat/backend/AbstractConfigurationWithShardingIT.java b/src/test/java/de/juplo/kafka/chat/backend/AbstractConfigurationWithShardingIT.java index e6fd95a9..5c9ac13f 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/AbstractConfigurationWithShardingIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/AbstractConfigurationWithShardingIT.java @@ -7,6 +7,8 @@ import org.testcontainers.shaded.org.awaitility.Awaitility; import java.time.Duration; +import static org.hamcrest.Matchers.endsWith; + public abstract class AbstractConfigurationWithShardingIT extends AbstractConfigurationIT { @@ -15,6 +17,7 @@ public abstract class AbstractConfigurationWithShardingIT extends AbstractConfig void testNotFoundForPutMessageToAChatRoomInNotOwnedShard() { String otherChatRoomId = "4e7246a6-29ae-43ea-b56f-669c3481ac19"; + int shard = 0; Awaitility .await() @@ -30,6 +33,9 @@ public abstract class AbstractConfigurationWithShardingIT extends AbstractConfig .accept(MediaType.APPLICATION_JSON) .bodyValue("The devil rules route 66") .exchange() - .expectStatus().isNotFound()); + .expectStatus().isNotFound() + .expectBody() + .jsonPath("$.type").value(endsWith("/problem/shard-not-owned")) + .jsonPath("$.shard").isEqualTo(shard)); } }