Skip to content

Commit

Permalink
refactor: 주소 변수명 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
1o18z committed Oct 3, 2023
1 parent d85a9e2 commit c6e148f
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class GetShopServiceTest : AnnotationSpec() {
"region1DepthName",
"region2DepthName",
"region3DepthName",
"region4DepthName"
"roadName"
)
),
mutableListOf(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class UpdateShopStatusServiceTest : AnnotationSpec() {
"region1DepthName",
"region2DepthName",
"region3DepthName",
"region4DepthName"
"roadName"
)
),
mutableListOf(),
Expand Down Expand Up @@ -70,7 +70,7 @@ class UpdateShopStatusServiceTest : AnnotationSpec() {
"region1DepthName",
"region2DepthName",
"region3DepthName",
"region4DepthName"
"roadName"
)
),
mutableListOf(),
Expand Down Expand Up @@ -102,7 +102,7 @@ class UpdateShopStatusServiceTest : AnnotationSpec() {
"region1DepthName",
"region2DepthName",
"region3DepthName",
"region4DepthName"
"roadName"
)
),
mutableListOf(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ class Address(
val region2DepthName: String,
@Column(name = "region_3depth_name")
val region3DepthName: String,
@Column(name = "region_4depth_name")
val region4DepthName: String
@Column(name = "road_name")
val roadName: String
) {

companion object {
fun of(
region1DepthName: String,
region2DepthName: String,
region3DepthName: String,
region4DepthName: String
roadName: String
): Address {

return Address(
region1DepthName,
region2DepthName,
region3DepthName,
region4DepthName
roadName
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ class AddressTest : AnnotationSpec() {
val region1DepthName = "서울"
val region2DepthName = "강남구"
val region3DepthName = "논현동"
val region4DepthName = "논현로"
val roadName = "논현로"

val address = Address.of(
region1DepthName,
region2DepthName,
region3DepthName,
region4DepthName
roadName
)

address.region1DepthName shouldBe region1DepthName
address.region2DepthName shouldBe region2DepthName
address.region3DepthName shouldBe region3DepthName
address.region4DepthName shouldBe region4DepthName
address.roadName shouldBe roadName
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ShopAddressTest : AnnotationSpec() {
"region1DepthName",
"region2DepthName",
"region3DepthName",
"region4DepthName"
"roadName"
)

val shopAddress = ShopAddress.of(
Expand All @@ -46,7 +46,7 @@ class ShopAddressTest : AnnotationSpec() {
"region1DepthName",
"region2DepthName",
"region3DepthName",
"region4DepthName"
"roadName"
)

shouldThrow<IllegalArgumentException> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SimpleAddressResolver : AddressResolver {
val region1DepthName = value[0]
val region2DepthName = value[1]
val region3DepthName = value.getOrNull(2) ?: ""
val region4DepthName = value.getOrNull(3) ?: ""
val roadName = value.getOrNull(3) ?: ""

// TODO: 좌표 및 지역 코드를 카카오 API에서 받아올 예정
return ShopAddress.of(
Expand All @@ -34,7 +34,7 @@ class SimpleAddressResolver : AddressResolver {
region1DepthName,
region2DepthName,
region3DepthName,
region4DepthName
roadName
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SimpleAddressResolverTest : AnnotationSpec() {
shopAddress.address.region1DepthName shouldBe "서울특별시"
shopAddress.address.region2DepthName shouldBe "강남구"
shopAddress.address.region3DepthName shouldBe "역삼동"
shopAddress.address.region4DepthName shouldBe "논현로"
shopAddress.address.roadName shouldBe "논현로"
}

@Test
Expand All @@ -38,7 +38,7 @@ class SimpleAddressResolverTest : AnnotationSpec() {
shopAddress.address.region1DepthName shouldBe "경기도"
shopAddress.address.region2DepthName shouldBe "남양주시"
shopAddress.address.region3DepthName shouldBe "다산동"
shopAddress.address.region4DepthName shouldBe ""
shopAddress.address.roadName shouldBe ""
}

@Test
Expand All @@ -54,7 +54,7 @@ class SimpleAddressResolverTest : AnnotationSpec() {
shopAddress.address.region1DepthName shouldBe "제주특별자치도"
shopAddress.address.region2DepthName shouldBe "한림읍"
shopAddress.address.region3DepthName shouldBe ""
shopAddress.address.region4DepthName shouldBe ""
shopAddress.address.roadName shouldBe ""
}

@Test
Expand Down

0 comments on commit c6e148f

Please sign in to comment.