Useful Mockito withSettings() Methods For Testing

In one of our previous articles How to Mock Variables for Interfaces and Casts in Java we described how to use the method withSettings().extraInterfaces() in order to add more interfaces / implementations to mocked objects. In this article we’ll look at other similar methods. The withSettings() method in Mockito provides several useful methods that can… read more »

What are Maven Profiles and How to Use Them

Maven profiles are a way to define a set of configuration options for a Maven build. Profiles are used to specify different build configurations for different environments or situations. For example, you may have a development profile that uses a local database for testing and a production profile that uses a remote database. Profiles can… read more »

How to Run Sites Securely with Apache and Php-fpm on Ubuntu 16.04 LTS

A great security feature of Php FastCGI Process Manager (Php-fpm) is its ability to run Php scripts with different users. This in addition to its other merits such as performance and many fine grained options for tuning makes it the best choice for running Php sites. Before anything else, I must admit that Nginx with… read more »

How To Create SSH Tunnel With Putty

SSH tunneling is very useful when the network access to a remote network is restricted. Thus, to gain remote network access you can use a tunnel to a remote host which would act as an intermediary. Here’s an example. Imagine, there’s a remote host which runs a Tomcat app servlet on TCP port 8080. The… read more »