-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat : domain 필드 추가 * feat : 도메인 파싱 응용 로직
- Loading branch information
1 parent
1354ade
commit 479dc52
Showing
4 changed files
with
59 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
domain/src/test/kotlin/com/pokit/content/model/ContentTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.pokit.content.model | ||
|
||
import io.kotest.core.spec.style.BehaviorSpec | ||
import io.kotest.matchers.shouldBe | ||
|
||
class ContentTest : BehaviorSpec({ | ||
Given("URL이 주어졌을 때") { | ||
val github = "https://github.com/YAPP-Github/24th-App-Team-4-BE/issues/50" | ||
val google = "https://www.google.com" | ||
val youtube = "https://youtu.be/bqSemSf0VqI?si=whk8MyNC_kGYB3Zl" | ||
val githubData = Content( | ||
categoryId = 1L, | ||
type = ContentType.LINK, | ||
data = github, | ||
title = "깃허브", | ||
memo = "test", | ||
alertYn = "YES" | ||
) | ||
val googleData = githubData.copy(data = google) | ||
val youtubeData = githubData.copy(data = youtube) | ||
When("도메인을 파싱하면") { | ||
githubData.parseDomain() | ||
googleData.parseDomain() | ||
youtubeData.parseDomain() | ||
Then("파싱된 도메인이 domain 필드에 저장된다.") { | ||
githubData.domain shouldBe "github" | ||
googleData.domain shouldBe "google" | ||
youtubeData.domain shouldBe "youtube" | ||
} | ||
} | ||
} | ||
}) |