작성자 없음
작성자 정보가 삭제된 글입니다.
해결된 질문
작성
·
253
1
public class OrderServiceTest {
MemberService memberService;
OrderService orderService;
@BeforeEach
public void beforeEach(){
AppConfig appConfig = new AppConfig();
memberService = appConfig.memberService();
orderService = appConfig.orderService();
}
@Test
void createOrder(){
Member memberA = new Member(1L,"memberA",Grade.VIP);
memberService.join(memberA);
Order o = orderService.createOrder(memberA.getId(),"a",10000);
Assertions.assertThat(o.getMemberId()).isEqualTo(memberA.getId());
}
}
public class OrderServiceTest {
AppConfig appConfig = new AppConfig();
MemberService memberService;
OrderService orderService;
@Test
void createOrder(){
memberService = appConfig.memberService();
orderService = appConfig.orderService();
Member memberA = new Member(1L,"memberA",Grade.VIP);
memberService.join(memberA);
Order o = orderService.createOrder(memberA.getId(),"a",10000);
Assertions.assertThat(o.getMemberId()).isEqualTo(memberA.getId());
}
}
역시.... 제 생각이 정말 단순하고 좁았네요! 빠른 답변 정말 감사합니다!