Does anyone have any good resources on integration testing? I’m very new to Kotlin / Spring and I’m just trying to get my head around testing a basic controller, creating the body of the POST request, etc…
Awesome! I didn’t see that when I first joined, thank you. I appreciate this list - starting on it right now. It’s crazy how slow a person can feel with a new language / framework. Googling even the most basic things 🙂
04/29/2018, 2:15 PM
One of possible learning paths (which I recommend to new hires in our team) is this:
1. read kotlin reference and do all kotlin koans at kotlinlang.org
2. Read several chapters of Spring reference docs and Spring boot reference
3. Work through some relevant Spring guides
4. Then I generally give some practice tasks relevant to the domain the new developer will be working on.
jumping right into the action while possible does not seem to give good results.
04/29/2018, 2:29 PM
you’re 100% right about that. this is one of those situations where I was brought in as a front-end dev but the upcoming sprint has not one single FE thing that isn’t blocked by something, so I’ve been assigned stuff on the backend.
the code was easy enough to write but the tests are giving me some issues, mostly related to my not actually understanding the ecosystem.
I’m coming from Typescript / JS so the typings are totally doable, and I did a lot of PHP / Ruby in the backend so OOP is ok, too. The setup is what’s a bit different - none of those languages compile like this does and the infrastructure is pretty different for me.
the funniest thing about it is that I got to work today and they’re like “oh that’s not set up at all, just move logic to a service and unit test”
which made me feel a little better about the whole situation 🙂
04/30/2018, 6:33 PM
It's really important to be able to unit test the services & the controllers independently. The MockMvc works just like Mockito so you can verify that the expected parameters are passed from the request to the service & that the formatting of the HttpResponse is correct.