Skip to content

Instantly share code, notes, and snippets.

@GHGHGHKO
Created February 23, 2023 12:04
Show Gist options
  • Select an option

  • Save GHGHGHKO/fa03538a8da1814e610ef8b667152850 to your computer and use it in GitHub Desktop.

Select an option

Save GHGHGHKO/fa03538a8da1814e610ef8b667152850 to your computer and use it in GitHub Desktop.
UserControllerTest BeforeEach
@BeforeEach
fun setUp() {
val roles = mutableListOf<String>()
roles.add("ROLE_USER")
roles.add("ROLE_ADMIN")
userMasterRepository.save(
UserMaster(
email = ADMIN,
password = passwordEncoder.encode(PASSWORD),
nickName = NICKNAME,
createUser = "setUpTestCode",
updateUser = "setUpTestCode",
roles = roles
)
)
val signInRequestDto = SignInRequestDto(
email = ADMIN,
password = PASSWORD
)
token = signService.signIn(signInRequestDto).token
for (i in 0..4) {
val signUpRequestDto = SignUpRequestDto(
email = ID + i + EMAIL,
password = PASSWORD,
nickname = NICKNAME
)
signService.signUp(signUpRequestDto)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment