TEST

    [JUnit5][SpringBoot][Kotlin] Exception테스트하기 (assertThrows)

    [JUnit5][SpringBoot][Kotlin] Exception테스트하기 (assertThrows)

    JUnit4 Junit4에서 exception 테스트는 @Test(expected=기대하는예외)를 통해 가능하다. (JUnit5와 비교하기 위한 예시코드이므로 정확하진 않을 수 있음) @Test(expected = NotEnoughStockException::class) fun 상품주문_재고수량초과() { val member = createMember("사용자") val book = createBook("도서명", 10000, 10, "저자명", "12345") val orderCount = 11 orderService.order(member.id!!, book.id!!, orderCount) fail("예외가 발생해야 한다."); } JUnit5 @Test에 expected를 쓸 수 없게 되어있어 다른..

    [Spring Boot] No tests found for given includes: 에러

    [Spring Boot] No tests found for given includes: 에러

    Spring Boot로 테스트 작성 후 IntelliJ내의 테스트 실행버튼을 눌러 테스트를 시도했다. 그런데... Execution failed for task ':test'. > No tests found for given includes: [test코드 경로](filter.includeTestsMatching) * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. 이렇게 떴다..!! 분명 @Test가 붙은 테스트들이 존재하는데...왜 없다고 하는 것인가? 인프런에 나와..