Posts Tagged: junit

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 […]

Gradle Multi-module Projects — Centralized Configuration

Posted by & filed under , .

This is a sweet gradle trick for those of you working on multi-module projects, if you are looking to centralize some of the configuration in the parent gradle build, and avoid repeating configuration / build code across sub-modules. Let’s say you have the following gradle project structure (see image below) where project A is the […]

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 […]

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 […]

Coding — My Daily Dose of Dopamine

Posted by & filed under , , .

I was asked recently by a friend of mine about what does my “standard” day of work consist of at Netflix. I had to explain to him that it’s hard to talk about a “standard” day as each day sees me looking at different pieces of our infrastructure and requires different challenges to be solved. […]

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 […]

What Most Schools Don’t Teach…

Posted by & filed under , , .

If you work in IT, you have probably by now have seen the famous video on YouTube labelled “What most schools don’t teach” — where Mark Zuckerberg, Bill Gates and a few other prominent figures are talking about how easy it is to program, and how only 10% of the USA schools teach programming. It […]

Cache Ahead using Apache Commons Pool

Posted by & filed under , .

If you have done any code that needs some sort of pooling of resources (which is some sort of caching, let’s face it), you would have no doubt come across Apache Commons Pool. (In fact the DBCP pool is used as a standard in applications which require database connection pooling.) The framework offers most of […]

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 […]