Skip to content

Commit

Permalink
refactor: DirtiesContext 어노테이션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
axhtl committed Aug 14, 2024
1 parent 5f1185d commit 43f92a0
Showing 1 changed file with 44 additions and 13 deletions.
57 changes: 44 additions & 13 deletions src/test/kotlin/org/store/clothstar/order/OrderIntegrationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.http.MediaType
import org.springframework.test.annotation.DirtiesContext
import org.springframework.test.context.ActiveProfiles
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.ResultActions
Expand All @@ -26,39 +27,69 @@ import org.store.clothstar.order.utils.CreateOrderObject
import org.store.clothstar.product.repository.ItemRepository
import org.store.clothstar.product.repository.ProductRepository

@Transactional
@SpringBootTest
@ActiveProfiles("test")
@AutoConfigureMockMvc
class OrderIntegrationTest {
@ActiveProfiles("test")
@Transactional
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
class OrderIntegrationTest(
@Autowired
private lateinit var mockMvc: MockMvc
private val mockMvc: MockMvc,

@Autowired
private lateinit var orderRepository: OrderRepository
private val orderRepository: OrderRepository,

@Autowired
private lateinit var memberRepository: MemberRepository
private val memberRepository: MemberRepository,

@Autowired
private lateinit var addressRepository: AddressRepository
private val addressRepository: AddressRepository,

@Autowired
private lateinit var categoryRepository: CategoryJpaRepository
private val categoryRepository: CategoryJpaRepository,

@Autowired
private lateinit var productRepository: ProductRepository
private val productRepository: ProductRepository,

@Autowired
private lateinit var itemRepository: ItemRepository
private val itemRepository: ItemRepository,

@Autowired
private lateinit var sellerRepository: SellerRepository
private val sellerRepository: SellerRepository,

@Autowired
private val orderDetailRepository: OrderDetailRepository,
) {
private val ORDER_URL: String = "/v1/orders"

@Autowired
private lateinit var orderDetailRepository: OrderDetailRepository
// @Autowired
// private lateinit var mockMvc: MockMvc
//
// @Autowired
// private lateinit var orderRepository: OrderRepository
//
// @Autowired
// private lateinit var memberRepository: MemberRepository
//
// @Autowired
// private lateinit var addressRepository: AddressRepository
//
// @Autowired
// private lateinit var categoryRepository: CategoryJpaRepository
//
// @Autowired
// private lateinit var productRepository: ProductRepository
//
// @Autowired
// private lateinit var itemRepository: ItemRepository
//
// @Autowired
// private lateinit var sellerRepository: SellerRepository
//
// private val ORDER_URL: String = "/v1/orders"
//
// @Autowired
// private lateinit var orderDetailRepository: OrderDetailRepository

@DisplayName("단일 주문 조회 통합테스트")
@Test
Expand Down

0 comments on commit 43f92a0

Please sign in to comment.