These are chat archives for TheHolyWaffle/TeamSpeak-3-Java-API

23rd
Dec 2017
somefriggnidiot
@somefriggnidiot
Dec 23 2017 03:57
Anyone ever try unit testing on this API? Having issues mocking out a CommandFuture response.
Roger Baumgartner
@rogermb
Dec 23 2017 14:06
No, not really. I considered it before, but there's actually very little code in this API where unit testing would make sense
All of the wrapper classes, events, command classes, and so on don't benefit from testing. Neither do TS3Api and TS3ApiAsync
And for all of the IO classes, an integration test would make much more sense than a unit test
somefriggnidiot
@somefriggnidiot
Dec 23 2017 16:59
I was talking more along the lines of the program built with this API. For example, say I've got a class that takes in a TextMessageEvent with the message !kick id reasonand processes that into TS3ApiAsync.kickClientFromServer(reason, id).onFailure( e -> { sendFailureMessageToInvoker() }). How would I mock that out if all I want to do is ensure sendFailureMessageToInvoker() is called when kickClientFromServer(reason, id) fails?
Roger Baumgartner
@rogermb
Dec 23 2017 18:04
If it's really that simple, I'm wondering if it's even worth testing.
But maybe you could mock TS3ApiAsync.kickClientFromServer(reason, id) to immediately return a CommandFuture that has already failed