Posts Tagged: unit test

network pc monitors

Parallel RxJava and Spock Oddity

Posted by & filed under , .

I use RxJava a lot nowadays — back in the day before I joined Netflix I was struggling with it a bit and mostly watched from the sideline but nowadays I find myself pulling in that dependency in a lot of the Java code I’m writing. And I also use the Spock framework a lot […]

iStock_blog write keyboard

Anti-pattern for testing RxJava code

Posted by & filed under , .

This is an obvious one but I find myself so often using it and every single time it means I have to spend extra time debugging my test / code until I realize that I’ve fallen for the same mistake again. I’m using RxJava here and using Groovy and Spock framework for testing — and […]

Disable PMD Plugin to Run for Test Sources

Posted by & filed under , .

I use PMD in my Gradle builds quite a bit. (Maybe a bit more nowadays that the FindBugs peeps seem to be struggling with that project — see this email from Andrey on this: https://mailman.cs.umd.edu/pipermail/findbugs-discuss/2016-November/004321.html). The issue I had with it is that there is no way to quickly turn off their checks for the src/test/… […]

Why You Should Use Default Methods in Java 8 Interfaces

Posted by & filed under , .

With Java 8, Oracle introduced the concept of “default methods” in interfaces (and if you really haven’t heard of this — wtf?? — you can read more here about it: https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html). This argue some is a step towards multiple inheritance and as such should be banished from the oh, so pure! Java language. Others point out […]

Odd Behaviour in Groovy when Comparing Maps

Posted by & filed under , .

I came across this the other day and I ended up spending quite some time on it pulling my hair and I still couldn’t explain it in the end so I thought  I’d post here to see if anyone can shed some light into it. In brief, it’s about Groovy’s (otherwise awesome!) feature of comparing […]

Scripting

Cobertura Issue with Ignoring Annotated Methods

Posted by & filed under , .

I’ve decided to plug in Cobertura in (some) of my projects to have an idea on the unit test/code coverage going on. I use Gradle, so I started looking at the Cobertura Gradle plugin. It turns out it’s pretty good — and offers a lot of the functionality that I needed. However, I came across […]

evernote

Storing Lists Using Evernote — via API

Posted by & filed under , , .

I’ve been playing for a while with Evernote and their API, which I find rather simple and effective (well done, guys!) — and as such on a few pet projects I have started considering moving the storage to Evernote itself. The beauty of using Evernote is that the storage is already structured for you in […]

java code

The joys of unit tests

Posted by & filed under , , .

I’m sure as a developer you’ve all heard of unit tests and best practices which preach to unit test your code in the finest details to ensure stability of the platform you are building. While my post does refer to Java (due to my recent experience) I am convinced that this can be applied to […]