У меня в контроллере есть следующий код:
Код: Выделить всё
@MessageMapping(MESSAGE_MAPPING)
public void sendVote(final RequestVoteDto vote, final Authentication authentication) {
final UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal();
voteService.createVote(vote, userDetails.getUsername());
}
Код: Выделить всё
@Test
@WithMockUser(username = "userTest")
@DisplayName("Send vote should be accessible for authorized user")
void testSendVote_shouldBeAccessibleForAuthorizedUser() throws Exception {
// test code here
}
Почему это происходит и как это исправить?
Подробнее здесь: https://stackoverflow.com/questions/793 ... n-the-test
Мобильная версия