|
@@ -38,11 +38,15 @@ public class TopicMessagesTests extends BaseTest {
|
|
|
.setName("topic-to-clear-message-attribute-" + randomAlphabetic(5))
|
|
|
.setMessageKey(fileToString(System.getProperty("user.dir") + "/src/test/resources/producedkey.txt"))
|
|
|
.setMessageContent(fileToString(System.getProperty("user.dir") + "/src/test/resources/testData.txt"));
|
|
|
+ private static final Topic TOPIC_TO_RECREATE = new Topic()
|
|
|
+ .setName("topic-to-recreate-attribute-" + randomAlphabetic(5))
|
|
|
+ .setMessageKey(fileToString(System.getProperty("user.dir") + "/src/test/resources/producedkey.txt"))
|
|
|
+ .setMessageContent(fileToString(System.getProperty("user.dir") + "/src/test/resources/testData.txt"));
|
|
|
private static final List<Topic> TOPIC_LIST = new ArrayList<>();
|
|
|
|
|
|
@BeforeAll
|
|
|
public void beforeAll() {
|
|
|
- TOPIC_LIST.addAll(List.of(TOPIC_FOR_MESSAGES, TOPIC_TO_CLEAR_MESSAGES));
|
|
|
+ TOPIC_LIST.addAll(List.of(TOPIC_FOR_MESSAGES, TOPIC_TO_CLEAR_MESSAGES, TOPIC_TO_RECREATE));
|
|
|
TOPIC_LIST.forEach(topic -> apiService.createTopic(CLUSTER_NAME, topic.getName()));
|
|
|
}
|
|
|
|
|
@@ -174,6 +178,41 @@ public class TopicMessagesTests extends BaseTest {
|
|
|
softly.assertAll();
|
|
|
}
|
|
|
|
|
|
+ @DisplayName("TopicTests.recreateTopic : Recreate topic")
|
|
|
+ @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
|
|
|
+ @AutomationStatus(status = Status.AUTOMATED)
|
|
|
+ @CaseId(240)
|
|
|
+ @Test
|
|
|
+ void checkRecreateTopic(){
|
|
|
+ navigateToTopicsAndOpenDetails(TOPIC_TO_RECREATE.getName());
|
|
|
+ topicDetails
|
|
|
+ .openDetailsTab(TopicDetails.TopicMenu.OVERVIEW)
|
|
|
+ .clickProduceMessageBtn();
|
|
|
+ produceMessagePanel
|
|
|
+ .waitUntilScreenReady()
|
|
|
+ .setContentFiled(TOPIC_TO_RECREATE.getMessageContent())
|
|
|
+ .setKeyField(TOPIC_TO_RECREATE.getMessageKey())
|
|
|
+ .submitProduceMessage();
|
|
|
+ topicDetails
|
|
|
+ .waitUntilScreenReady();
|
|
|
+ navigateToTopics();
|
|
|
+ topicsList
|
|
|
+ .waitUntilScreenReady();
|
|
|
+ assertThat(topicsList.getTopicItem(TOPIC_TO_RECREATE.getName()).getNumberOfMessages())
|
|
|
+ .as("getNumberOfMessages()").isEqualTo(1);
|
|
|
+ topicsList
|
|
|
+ .openDotMenuByTopicName(TOPIC_TO_RECREATE.getName())
|
|
|
+ .clickRecreateTopicBtn()
|
|
|
+ .clickConfirmBtnMdl();
|
|
|
+ SoftAssertions softly = new SoftAssertions();
|
|
|
+ softly.assertThat(topicDetails.isAlertWithMessageVisible(SUCCESS,
|
|
|
+ String.format("Topic %s successfully recreated!", TOPIC_TO_RECREATE.getName())))
|
|
|
+ .as("isAlertWithMessageVisible()").isTrue();
|
|
|
+ softly.assertThat(topicsList.getTopicItem(TOPIC_TO_RECREATE.getName()).getNumberOfMessages())
|
|
|
+ .as("getNumberOfMessages()").isEqualTo(0);
|
|
|
+ softly.assertAll();
|
|
|
+ }
|
|
|
+
|
|
|
@AfterAll
|
|
|
public void afterAll() {
|
|
|
TOPIC_LIST.forEach(topic -> apiService.deleteTopic(CLUSTER_NAME, topic.getName()));
|