-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace getAsTag() with getName() on user entity #1016
replace getAsTag() with getName() on user entity #1016
Conversation
@Zabuzard i see you wrote RemindRoutineTest.java This is causing some trouble and i have no clue, basically replacing with Perhaps you have some insight ? |
Kindly commit and push the change, so I can see the full log with the exact failed test and everything in the CI/CD logs, thank you. |
@ankitsmt211 the error message is
Now, unfortunately I am lacking the full stacktrace. So if you would please run the test manually and send the full stacktrace, that would be awesome 👍 |
@Zabuzard Please have a look
|
@ankitsmt211 thanks, fixed. Let me quickly explain. String authorName = author == null ? "Unknown user" : author.getName(); returned EmbedBuilder().setAuthor(authorName, null, authorIconUrl) An embed with So now you have to find out why UserImpl user = spy(new UserImpl(USER_ID, jda)); Thats the user used on all those messages. In practice, outside of tests, all those fields are populated by the real JDA when receiving Discord API responses etc. But during tests, we have to mock what JDA does ourselves. And this is (obviously) only done to the extend we actually needed. And you just went beyond what was already covered with your change - our mock users had no names yet. |
i think get the idea, by default all mocked values are null unless specified. But i couldn't track down the source where mocked user was setup, thanks for resolving the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be merged when the coast is clear. High merge conflict potential. ^^
* replace getAsTag() with getName() on user entity * problematic changes in RemindRoutine related classes * addition to problematic changes * fixed failing tests --------- Co-authored-by: Zabuzard <[email protected]>
replaces User#getAsTag() with User#getName() throughout code, except
RemindRoutine.java
,RemindRoutineTest.java
(facing some issues in two tests from RemindRoutineTest)and
FilesharingListener.java
(already active PR)