merge
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.springframework.boot.gradle.tasks.bundling.BootJar
|
||||
|
||||
@@ -72,7 +74,20 @@ subprojects {
|
||||
}
|
||||
}
|
||||
|
||||
// gradle test logging
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
|
||||
testLogging {
|
||||
events(
|
||||
TestLogEvent.FAILED,
|
||||
TestLogEvent.STANDARD_ERROR,
|
||||
)
|
||||
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
showExceptions = true
|
||||
showCauses = true
|
||||
showStackTraces = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,15 +87,16 @@ internal class CafeServiceTest {
|
||||
fun update_cafe_test() {
|
||||
// given
|
||||
val (name, address, phoneNumber, description, cafeMenuList) = CafeTestUtils.createCafeRegisterRequest()
|
||||
val cafe = Cafe.createCafe(
|
||||
name = name!!,
|
||||
address = address!!,
|
||||
phoneNumber = phoneNumber!!,
|
||||
description = description!!,
|
||||
cafeMenuRequestList = cafeMenuList
|
||||
)
|
||||
// val cafe = Cafe.createCafe(
|
||||
// name = name!!,
|
||||
// address = address!!,
|
||||
// phoneNumber = phoneNumber!!,
|
||||
// description = description!!,
|
||||
// cafeMenuRequestList = cafeMenuList
|
||||
// )
|
||||
val cafeId = 50L
|
||||
|
||||
throw RuntimeException()
|
||||
// TODO 'findByIdOrNull'은 kotlin test 라이브러리 필요한 듯
|
||||
val mockCafe = mock(Cafe::class.java)
|
||||
`when`(mockCafeRepository.findById(cafeId)).thenReturn(Optional.of(mockCafe))
|
||||
|
||||
Reference in New Issue
Block a user