Skip to content

Commit

Permalink
refactor: allure 문서화를 위한 어노테이션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 committed Dec 20, 2024
1 parent ac4d81d commit db94f22
Show file tree
Hide file tree
Showing 24 changed files with 138 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.few.api.domain.workbook.article.usecase.ReadWorkBookArticleUseCase
import com.few.api.domain.workbook.controller.WorkBookController
import com.few.api.domain.workbook.usecase.BrowseWorkbooksUseCase
import com.few.api.domain.workbook.usecase.ReadWorkbookUseCase
import io.qameta.allure.Epic
import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs
Expand All @@ -41,6 +42,7 @@ import security.TokenResolver
import security.config.SecurityConfig
import web.config.WebConfig

@Epic("V1.0 API")
@ActiveProfiles(value = ["test", "new"])
@AutoConfigureRestDocs
@AutoConfigureMockMvc(addFilters = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import com.few.api.config.web.controller.ApiControllerTestSpec
import com.few.api.domain.admin.controller.request.*
import com.few.api.domain.admin.usecase.dto.*
import com.few.api.domain.common.vo.CategoryType
import io.qameta.allure.Feature
import io.qameta.allure.Story
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import org.mockito.Mockito.doNothing
Expand All @@ -23,6 +25,7 @@ import web.helper.*
import java.net.URL
import java.util.stream.IntStream

@Feature("Admin API")
class AdminApiControllerTest : ApiControllerTestSpec() {
companion object {
private const val BASE_URL = "/api/v1/admin"
Expand All @@ -31,6 +34,7 @@ class AdminApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[POST] /api/v1/admin/workbooks")
@Story("[POST] /api/v1/admin/workbooks")
fun addWorkbook() {
// given
val api = "AddWorkbook"
Expand Down Expand Up @@ -85,6 +89,7 @@ class AdminApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[POST] /api/v1/admin/articles")
@Story("[POST] /api/v1/admin/articles")
fun addArticle() {
// given
val api = "AddArticle"
Expand Down Expand Up @@ -182,6 +187,7 @@ class AdminApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[POST] /api/v1/admin/relations/articles")
@Story("[POST] /api/v1/admin/relations/articles")
fun mapArticle() {
// given
val api = "MapArticle"
Expand Down Expand Up @@ -230,6 +236,7 @@ class AdminApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[POST] /api/v1/admin/utilities/conversion/content")
@Story("[POST] /api/v1/admin/utilities/conversion/content")
fun convertContent() {
// given
val api = "ConvertContent"
Expand Down Expand Up @@ -281,6 +288,7 @@ class AdminApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[POST] /api/v1/utilities/conversion/image")
@Story("[POST] /api/v1/utilities/conversion/image")
fun putImage() {
// given
val api = "PutImage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import com.epages.restdocs.apispec.Schema
import com.few.api.config.web.controller.ApiControllerTestSpec
import com.few.api.domain.article.usecase.dto.*
import com.few.api.domain.common.vo.CategoryType
import io.qameta.allure.Feature
import io.qameta.allure.Story
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import org.mockito.Mockito.`when`
Expand All @@ -21,6 +23,7 @@ import java.net.URL
import java.time.LocalDateTime
import java.util.stream.IntStream

@Feature("Article API")
class ArticleApiControllerTest : ApiControllerTestSpec() {
companion object {
private const val BASE_URL = "/api/v1/articles"
Expand All @@ -32,6 +35,7 @@ class ArticleApiControllerTest : ApiControllerTestSpec() {
*/
@Test
@DisplayName("[GET] /api/v1/articles/{articleId}")
@Story("[GET] /api/v1/articles/{articleId}")
fun readArticle() {
// given
val api = "ReadArticle"
Expand Down Expand Up @@ -122,6 +126,7 @@ class ArticleApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[GET] /api/v1/articles?prevArticleId={optional}?categoryCd={optional}")
@Story("[GET] /api/v1/articles?prevArticleId={optional}?categoryCd={optional}")
fun readArticles() {
// given
val api = "ReadArticles"
Expand Down Expand Up @@ -224,6 +229,7 @@ class ArticleApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[GET] /api/v1/articles/categories")
@Story("[GET] /api/v1/articles/categories")
fun browseArticleCategories() {
// given
val api = "browseArticleCategories"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ import io.kotest.assertions.throwables.shouldThrow
import io.kotest.core.spec.style.BehaviorSpec
import io.kotest.matchers.shouldBe
import io.mockk.*
import io.qameta.allure.Epic
import io.qameta.allure.Feature
import io.qameta.allure.Story
import org.springframework.context.ApplicationEventPublisher
import java.net.URL
import java.time.LocalDateTime

@Epic("V1.0 UseCase")
@Feature("Article")
@Story("ReadArticle")
class ReadArticleUseCaseTest :
BehaviorSpec({
val log = KotlinLogging.logger {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import com.epages.restdocs.apispec.Schema
import com.few.api.config.web.controller.ApiControllerTestSpec
import com.few.api.domain.log.controller.request.ApiLogRequest
import com.few.api.domain.log.dto.AddApiLogUseCaseIn
import io.qameta.allure.Feature
import io.qameta.allure.Story
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import org.mockito.Mockito
Expand All @@ -18,6 +20,7 @@ import web.helper.toIdentifier
import web.helper.toRequestSchema
import web.helper.toResponseSchema

@Feature("API Log API")
class ApiLogApiControllerTest : ApiControllerTestSpec() {
companion object {
private const val BASE_URL = "/api/v1/logs"
Expand All @@ -26,6 +29,7 @@ class ApiLogApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[POST] /api/v1/logs")
@Story("[POST] /api/v1/logs")
fun addApiLog() {
// Given
val api = "addApiLog"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import com.few.api.domain.member.usecase.dto.SaveMemberUseCaseIn
import com.few.api.domain.member.usecase.dto.SaveMemberUseCaseOut
import com.few.api.domain.member.usecase.dto.TokenUseCaseIn
import com.few.api.domain.member.usecase.dto.TokenUseCaseOut
import io.qameta.allure.Feature
import io.qameta.allure.Story
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import org.mockito.Mockito.`when`
Expand All @@ -23,6 +25,7 @@ import web.description.Description
import web.helper.*

@Suppress("ktlint:standard:property-naming", "ktlint:standard:max-line-length")
@Feature("Member API")
class MemberApiControllerTest : ApiControllerTestSpec() {
companion object {
private const val BASE_URL = "/api/v1/members"
Expand All @@ -31,6 +34,7 @@ class MemberApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[POST] /api/v1/members")
@Story("[POST] /api/v1/members")
fun saveMember() {
// given
val api = "SaveMember"
Expand Down Expand Up @@ -80,6 +84,7 @@ class MemberApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[POST] /api/v1/members/token")
@Story("[POST] /api/v1/members/token")
fun token() {
// given
val api = "Token"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ import io.kotest.matchers.shouldBe
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import io.qameta.allure.Epic
import io.qameta.allure.Feature
import io.qameta.allure.Story
import org.mockito.ArgumentMatchers.any
import security.encryptor.IdEncryptor

@Epic("V1.0 UseCase")
@Feature("Member")
@Story("SaveMember")
class SaveMemberUseCaseTest :
BehaviorSpec({
lateinit var memberDao: MemberDao
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ import io.kotest.matchers.shouldBe
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import io.qameta.allure.Epic
import io.qameta.allure.Feature
import io.qameta.allure.Story
import security.AuthToken
import security.TokenGenerator
import security.TokenResolver
import security.encryptor.IdEncryptor

@Epic("V1.0 UseCase")
@Feature("Member")
@Story("Token")
class TokenUseCaseTest :
BehaviorSpec({
lateinit var tokenGenerator: TokenGenerator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import com.epages.restdocs.apispec.Schema
import com.few.api.config.web.controller.ApiControllerTestSpec
import com.few.api.domain.problem.controller.request.CheckProblemRequest
import com.few.api.domain.problem.usecase.dto.*
import io.qameta.allure.Feature
import io.qameta.allure.Story
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import org.mockito.Mockito.`when`
Expand All @@ -20,6 +22,7 @@ import web.description.Description
import web.helper.*

@Suppress("ktlint:standard:max-line-length")
@Feature("Problem API")
class ProblemApiControllerTest : ApiControllerTestSpec() {
companion object {
private const val BASE_URL = "/api/v1/problems"
Expand All @@ -28,6 +31,7 @@ class ProblemApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[GET] /api/v1/problems?articleId=")
@Story("[GET] /api/v1/problems?articleId=")
fun browseProblems() {
// given
val api = "BrowseProblems"
Expand Down Expand Up @@ -78,6 +82,7 @@ class ProblemApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[GET] /api/v1/problems/{problemId}")
@Story("[GET] /api/v1/problems/{problemId}")
fun readProblem() {
// given
val api = "ReadProblem"
Expand Down Expand Up @@ -144,6 +149,7 @@ class ProblemApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[POST] /api/v1/problems/{problemId}")
@Story("[POST] /api/v1/problems/{problemId}")
fun checkProblem() {
// given
val api = "CheckProblem"
Expand Down Expand Up @@ -203,6 +209,7 @@ class ProblemApiControllerTest : ApiControllerTestSpec() {

@Test
@DisplayName("[GET] /api/v1/problems/unsubmitted")
@Story("[GET] /api/v1/problems/unsubmitted")
fun browseUndoneProblems() {
// given
val api = "BrowseUndoneProblems"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ import io.kotest.matchers.shouldBe
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import io.qameta.allure.Epic
import io.qameta.allure.Feature
import io.qameta.allure.Story

@Epic("V1.0 UseCase")
@Feature("Problem")
@Story("BrowseProblems")
class BrowseProblemsUseCaseTest :
BehaviorSpec({

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ import io.kotest.core.spec.style.BehaviorSpec
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import io.qameta.allure.Epic
import io.qameta.allure.Feature
import io.qameta.allure.Story

@Epic("V1.0 UseCase")
@Feature("Problem")
@Story("BrowseUndoneProblems")
class BrowseUndoneProblemsUseCaseTest :
BehaviorSpec({
lateinit var problemDao: ProblemDao
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ import io.kotest.matchers.shouldBe
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import io.qameta.allure.Epic
import io.qameta.allure.Feature
import io.qameta.allure.Story

@Epic("V1.0 UseCase")
@Feature("Problem")
@Story("CheckProblem")
class CheckProblemUseCaseTest :
BehaviorSpec({

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ import io.kotest.matchers.shouldBe
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import io.qameta.allure.Epic
import io.qameta.allure.Feature
import io.qameta.allure.Story
import java.util.stream.IntStream

@Epic("V1.0 UseCase")
@Feature("Problem")
@Story("ReadProblem")
class ReadProblemUseCaseTest :
BehaviorSpec({

Expand Down
Loading

0 comments on commit db94f22

Please sign in to comment.