Support for multiple clients has now been implemented. When making this system, initially I made it work on just one client, because I knew that adding features later to a simple codebase is easy and then your understanding of the problem will be better. It took only a bit over 4 hours to add support for more than one client - surely not much longer than if I had built it in already in the beginning.
When the test have responses as a Set instead of aList, doesn't that hide any possible duplicates? Keep the responses as a List and assert that the list does not contain duplicates.
ReplyDeleteFestAssert syntax would be
assertThat(responses).contains(1, 2, 3, 4).doesNotHaveDuplicates();
Then again, I do not know Scala, but still find your vidoes very interesting!
Yes, you're right. It was bad of me to ignore the order in which the events were processed, especially in a way which makes the test so relaxed. And anyways my design principle is to make this system as deterministic as possible, so maintaining FIFO order should be the default option.
ReplyDeleteI realized it after I had recorded this episode and fixed it off-camera. The issue was that I was using Scala's List and new items are always added to the beginning of a List, so you need to remember to reverse it. I fixed it by using Buffer and Seq which are similar to Java's List: https://github.com/orfjackal/dimdwarf/commit/876ca3024717384c06d77bd708aeccebba149b28