|
@@ -1,5 +1,6 @@
|
|
|
package com.provectus.kafka.ui;
|
|
|
|
|
|
+import com.provectus.kafka.ui.api.model.TopicConfig;
|
|
|
import com.provectus.kafka.ui.model.BrokerConfig;
|
|
|
import com.provectus.kafka.ui.model.PartitionsIncrease;
|
|
|
import com.provectus.kafka.ui.model.PartitionsIncreaseResponse;
|
|
@@ -127,6 +128,12 @@ public class KafkaConsumerTests extends AbstractBaseTest {
|
|
|
.exchange()
|
|
|
.expectStatus()
|
|
|
.isNotFound();
|
|
|
+
|
|
|
+ webTestClient.get()
|
|
|
+ .uri("/api/clusters/{clusterName}/topics/{topicName}/config", LOCAL, topicName)
|
|
|
+ .exchange()
|
|
|
+ .expectStatus()
|
|
|
+ .isNotFound();
|
|
|
}
|
|
|
|
|
|
@Test
|
|
@@ -144,18 +151,17 @@ public class KafkaConsumerTests extends AbstractBaseTest {
|
|
|
.returnResult()
|
|
|
.getResponseBody();
|
|
|
|
|
|
- assert configs != null;
|
|
|
+ Assertions.assertNotNull(configs);
|
|
|
assert !configs.isEmpty();
|
|
|
- Assertions.assertNotEquals(null, configs.get(0).getName());
|
|
|
- Assertions.assertNotEquals(null, configs.get(0).getIsReadOnly());
|
|
|
- Assertions.assertNotEquals(null, configs.get(0).getIsSensitive());
|
|
|
- Assertions.assertNotEquals(null, configs.get(0).getSource());
|
|
|
+ Assertions.assertNotNull(configs.get(0).getName());
|
|
|
+ Assertions.assertNotNull(configs.get(0).getIsReadOnly());
|
|
|
+ Assertions.assertNotNull(configs.get(0).getIsSensitive());
|
|
|
+ Assertions.assertNotNull(configs.get(0).getSource());
|
|
|
+ Assertions.assertNotNull(configs.get(0).getSynonyms());
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
public void shouldReturn404ForNonExistingBroker() {
|
|
|
- var topicName = UUID.randomUUID().toString();
|
|
|
-
|
|
|
webTestClient.get()
|
|
|
.uri("/api/clusters/{clusterName}/brokers/{id}/configs",
|
|
|
LOCAL,
|
|
@@ -164,4 +170,38 @@ public class KafkaConsumerTests extends AbstractBaseTest {
|
|
|
.expectStatus()
|
|
|
.isNotFound();
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void shouldRetrieveTopicConfig() {
|
|
|
+ var topicName = UUID.randomUUID().toString();
|
|
|
+
|
|
|
+ webTestClient.post()
|
|
|
+ .uri("/api/clusters/{clusterName}/topics", LOCAL)
|
|
|
+ .bodyValue(new TopicCreation()
|
|
|
+ .name(topicName)
|
|
|
+ .partitions(1)
|
|
|
+ .replicationFactor(1)
|
|
|
+ .configs(Map.of())
|
|
|
+ )
|
|
|
+ .exchange()
|
|
|
+ .expectStatus()
|
|
|
+ .isOk();
|
|
|
+
|
|
|
+ List<TopicConfig> configs = webTestClient.get()
|
|
|
+ .uri("/api/clusters/{clusterName}/topics/{topicName}/config", LOCAL, topicName)
|
|
|
+ .exchange()
|
|
|
+ .expectStatus()
|
|
|
+ .isOk()
|
|
|
+ .expectBodyList(TopicConfig.class)
|
|
|
+ .returnResult()
|
|
|
+ .getResponseBody();
|
|
|
+
|
|
|
+ Assertions.assertNotNull(configs);
|
|
|
+ assert !configs.isEmpty();
|
|
|
+ Assertions.assertNotNull(configs.get(0).getName());
|
|
|
+ Assertions.assertNotNull(configs.get(0).getIsReadOnly());
|
|
|
+ Assertions.assertNotNull(configs.get(0).getIsSensitive());
|
|
|
+ Assertions.assertNotNull(configs.get(0).getSource());
|
|
|
+ Assertions.assertNotNull(configs.get(0).getSynonyms());
|
|
|
+ }
|
|
|
}
|