From 37c538f521319cbf8e1e52706101dfbca1641822 Mon Sep 17 00:00:00 2001 From: nntthuy-axonivy Date: Fri, 13 Dec 2024 08:33:17 +0700 Subject: [PATCH] Add unit test --- .../axonivy/market/util/ProductContentUtilsTest.java | 10 ++++++++++ marketplace-service/src/test/resources/README.md | 2 ++ 2 files changed, 12 insertions(+) diff --git a/marketplace-service/src/test/java/com/axonivy/market/util/ProductContentUtilsTest.java b/marketplace-service/src/test/java/com/axonivy/market/util/ProductContentUtilsTest.java index c302c66e..dac89bb7 100644 --- a/marketplace-service/src/test/java/com/axonivy/market/util/ProductContentUtilsTest.java +++ b/marketplace-service/src/test/java/com/axonivy/market/util/ProductContentUtilsTest.java @@ -114,6 +114,16 @@ void testGetExtractedPartsOfEmptyReadme() { assertTrue(StringUtils.isBlank(readmeContentsModel.getSetup())); } + @Test + void testGetExtractedPartsOfReadmeAtCorrectHeadings() { + String readmeContents = getMockReadmeContent(); + ReadmeContentsModel readmeContentsModel = ProductContentUtils.getExtractedPartsOfReadme(readmeContents); + assertTrue(readmeContentsModel.getDescription().startsWith("Axon Ivy’s mattermost connector")); + assertTrue(readmeContentsModel.getDemo().startsWith("### Demo sample")); + assertTrue(readmeContentsModel.getSetup().startsWith("### Setup guideline")); + + } + @Test void testHasImageDirectives() { String readmeContents = getMockReadmeContent(); diff --git a/marketplace-service/src/test/resources/README.md b/marketplace-service/src/test/resources/README.md index c86eea4e..c68b040e 100644 --- a/marketplace-service/src/test/resources/README.md +++ b/marketplace-service/src/test/resources/README.md @@ -12,6 +12,7 @@ This connector: ## Demo +### Demo sample 1. Hit the slash command key on the channel's chat. The Axon Ivy process will be triggered and create a new task. The task's information will be sent to the channel by a message. @@ -20,6 +21,7 @@ This connector: ## Setup +### Setup guideline Mattermost Instance 1. Ref to [Deploy Mattermost](https://docs.mattermost.com/guides/deployment.html).