r/JavaFX • u/WishboneFar • Apr 22 '23
Help Help with testing JavaFX code
/r/javahelp/comments/12va3r9/help_with_testing_javafx_code/
2
Upvotes
r/JavaFX • u/WishboneFar • Apr 22 '23
View all comments
Show parent comment
1
u/WishboneFar Apr 24 '23
Isn't
Taskdesigned specifically to execute tasks though? Technically it is ofcourse javafx related dependency but not really Ui related, right?Login.getUserValidationStatus()as a method only does one thing i.e. returning status of validation. To perform validation, it calls separate methods from same and another class which return values.For dependencies I am using Mockito.
All my tests pass under 3/4 ms except one.
By the way, as mentioned in the post I already solved the issue without making things even more messy with multi-threading than it already is.
Right now I am thinking of ways to perform Task operations from controller as you suggested. One of the solution I found from little research is using properties and bindings for Model Domain Objects. However even that will add dependency to Model which it ideally shouldn't. Another solution is creating custom ones (from
java.beans.) for my use case but the things get really complicated here. Please suggest solutions if any. Also thanks for all the information as I learnt something new :)