How to mock the java URL class with mockito

How to mock the java URL class with mockito

Unit testing classes that use java’s URL class The java URL class java.net.URL models a remote resource location, and provides methods to retrieve resource content.  Common use cases are to retrieve resources over HTTP/S, but it can also be used to retrieve files or classpath resources.  Typically, the URL instance is constructed within your class method: To […]

How to use grunt in your maven lifecycle

How to use grunt in your maven lifecycle

Maven is the build lifecycle tool for your java projects; grunt is the build lifecycle tool for your front end projects. Can they coexist, and if so how? Unless you are using groovy in which case you are most likely using gradle, Maven (mvn) is the defacto build tool for java projects. It’s mature and well […]

To Unit Test or Integration Test

To Unit Test or Integration Test

To Unit Test or Integration Test … that is the question. And that is the subject of this post. I will be exploring whether it is better to write Unit Tests or Integration Tests, or whether there is a sweet spot in the middle ground somewhere. Striking the right balance It’s hard to get the balance right. […]

What is mobile?

What is mobile?

In the world of web development, ‘mobile’ is … … actually, it’s not that easy! Using some real examples from a recent project, I aim to discuss some of the requirements we might get as developers with a view to understanding that the term ‘mobile’ is not as straightforward as we might think, and that doing ‘mobile’ web […]

Responsive vs. adaptive design

Responsive vs. adaptive design

Unfortunately in our world of web development, tech terms are often overloaded which causes a lack of common understanding, which in turn leads to misuse and confusion. Responsive and adaptive web design are two such terms. Broadly speaking they both refer to the ability of a site to display or operate differently based on factors of the […]

Unit testing and expected exceptions

Unit testing and expected exceptions

Testing for expected exceptions Unit testing – we’re all well versed at it by now, we know why we do it and we know how to do it. It’s baked into our development lifecycle and we do it well. Right? … This post looks at the case where we are expecting a given test scenario […]