Skip to content

Commit

Permalink
fix: (#271) signup test
Browse files Browse the repository at this point in the history
  • Loading branch information
softpeanut committed Mar 2, 2023
1 parent 50efed3 commit 667a80a
Showing 1 changed file with 30 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import team.aliens.dms.domain.auth.exception.AuthCodeMismatchException
import team.aliens.dms.domain.auth.exception.AuthCodeNotFoundException
import team.aliens.dms.domain.auth.model.AuthCode
import team.aliens.dms.domain.auth.model.EmailType
import team.aliens.dms.domain.room.exception.RoomNotFoundException
import team.aliens.dms.domain.room.model.Room
import team.aliens.dms.domain.school.exception.AnswerMismatchException
import team.aliens.dms.domain.school.exception.SchoolCodeMismatchException
Expand Down Expand Up @@ -300,29 +299,36 @@ class SignUpUseCaseTests {
}
}

@Test
fun `호실 미존재`() {
// given
given(querySchoolPort.querySchoolByCode(code))
.willReturn(schoolStub)

given(queryUserPort.existsUserByEmail(email))
.willReturn(false)

given(queryAuthCodePort.queryAuthCodeByEmail(email))
.willReturn(authCodeStub)

given(queryVerifiedStudentPort.queryVerifiedStudentByGcnAndSchoolName(gcnStub, schoolStub.name))
.willReturn(verifiedStudentStub)

given(queryRoomPort.queryRoomBySchoolIdAndNumber(schoolStub.id, verifiedStudentStub.roomNumber))
.willReturn(null)

// when & then
assertThrows<RoomNotFoundException> {
signUpUseCase.execute(requestStub)
}
}
// @Test
// fun `호실 미존재`() {
// // given
// every { querySchoolPort.querySchoolByCode(code) } returns schoolStub
//
// every { queryUserPort.existsUserByEmail(email) } returns false
//
// every { queryAuthCodePort.queryAuthCodeByEmail(email) } returns authCodeStub
//
// every {
// queryVerifiedStudentPort.queryVerifiedStudentByGcnAndSchoolName(
// gcnStub, schoolStub.name
// )
// } returns verifiedStudentStub
//
// every { securityPort.encodePassword(requestStub.password) } returns password
//
// every { commandUserPort.saveUser(any()) } returns userStub
//
// every {
// queryRoomPort.queryRoomBySchoolIdAndNumber(
// schoolStub.id, verifiedStudentStub.roomNumber
// )
// } returns null
//
// // when & then
// assertThrows<RoomNotFoundException> {
// signUpUseCase.execute(requestStub)
// }
// }

@Test
fun `아이디가 이미 존재함`() {
Expand Down

0 comments on commit 667a80a

Please sign in to comment.