Software Development

Void methods and Mockito in Java

When we talk about unit tests, we think about input values and return values to/from methods. Returned values are checked against expected values as a way to verify behavior of codes. But how would you test codes that do not return any values? Essentially, we resort to stubbing out void methods. That is easy in Mockito!

Software Development

Inheritance in Object-oriented JavaScript

Inheritance in JavaScript is called prototypal inheritance. Objects inherit from objects. When we create an object from a class, [wp_ad_camp_5]

it always inherits from

In Java speak, this is like saying  “any class inherits from Object class”.

Software Development

Capture Argument To Method in Mockito

This post shows how to capture arguments our codes passed to a mock’s method. To do this, a method must accept reference types. Then, we use Mockito.verify() method. Then, pass an instance of ArgumentCaptor to the mock’s method. Capture Argument

Software Development

Using JDK 9 with Eclipse Luna

JDK 9 works with Eclipse Mars [wp_ad_camp_5] First and foremost, Eclipse Luna does not work with JDK 9 because of JEP 220: Modular Run-Time Images. There is Eclipse Mars for that. Updating eclipse.ini to use JDK 9 JEP 220 changed